Skip to content

Commit a694b96

Browse files
committed
Fix assumed tween order for transition tests.
1 parent 2e1b96a commit a694b96

3 files changed

Lines changed: 23 additions & 23 deletions

File tree

test/transition/transition-test-attrTween.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ module.exports = {
3535

3636
// The order here is a bit brittle: because the transition has zero delay,
3737
// it's invoking the start event immediately for all nodes, rather than
38-
// pushing each node onto the timer queue (which would reverse the order of
39-
// callbacks). The order in which tweens are invoked is undefined, so perhaps
40-
// we should sort the expected and actual values before comparing.
38+
// pushing each node onto the timer queue. The order in which tweens are
39+
// invoked is undefined (see #1245), so perhaps we should sort the expected
40+
// and actual values before comparing.
4141

4242
"defines the corresponding attr tween": function(result) {
4343
assert.typeOf(result.transition.tween("attr.color"), "function");
4444
},
4545
"invokes the tween function": function(result) {
46-
assert.deepEqual(result.data, ["green", "red"], "expected data, got {actual}");
47-
assert.deepEqual(result.index, [1, 0], "expected data, got {actual}");
48-
assert.deepEqual(result.value, ["#008000", "#ff0000"], "expected value, got {actual}");
49-
assert.domEqual(result.context[0], result.selection[0][1], "expected this, got {actual}");
50-
assert.domEqual(result.context[1], result.selection[0][0], "expected this, got {actual}");
46+
assert.deepEqual(result.data, ["red", "green"], "expected data, got {actual}");
47+
assert.deepEqual(result.index, [0, 1], "expected data, got {actual}");
48+
assert.deepEqual(result.value, ["#ff0000", "#008000"], "expected value, got {actual}");
49+
assert.domEqual(result.context[0], result.selection[0][0], "expected this, got {actual}");
50+
assert.domEqual(result.context[1], result.selection[0][1], "expected this, got {actual}");
5151
},
5252

5353
"end": {

test/transition/transition-test-styleTween.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ module.exports = {
3838

3939
// The order here is a bit brittle: because the transition has zero delay,
4040
// it's invoking the start event immediately for all nodes, rather than
41-
// pushing each node onto the timer queue (which would reverse the order of
42-
// callbacks). The order in which tweens are invoked is undefined, so perhaps
43-
// we should sort the expected and actual values before comparing.
41+
// pushing each node onto the timer queue. The order in which tweens are
42+
// invoked is undefined (see #1245), so perhaps we should sort the expected
43+
// and actual values before comparing.
4444

4545
"defines the corresponding style tween": function(result) {
4646
assert.typeOf(result.transition.tween("style.background-color"), "function");
@@ -49,11 +49,11 @@ module.exports = {
4949
assert.equal(result.fails, 0);
5050
},
5151
"invokes the tween function": function(result) {
52-
assert.deepEqual(result.data, ["green", "red"], "expected data, got {actual}");
53-
assert.deepEqual(result.index, [1, 0], "expected index, got {actual}");
54-
assert.deepEqual(result.value, ["#008000", "#ff0000"], "expected value, got {actual}");
55-
assert.domEqual(result.context[0], result.selection[0][1], "expected this, got {actual}");
56-
assert.domEqual(result.context[1], result.selection[0][0], "expected this, got {actual}");
52+
assert.deepEqual(result.data, ["red", "green"], "expected data, got {actual}");
53+
assert.deepEqual(result.index, [0, 1], "expected index, got {actual}");
54+
assert.deepEqual(result.value, ["#ff0000", "#008000"], "expected value, got {actual}");
55+
assert.domEqual(result.context[0], result.selection[0][0], "expected this, got {actual}");
56+
assert.domEqual(result.context[1], result.selection[0][1], "expected this, got {actual}");
5757
},
5858

5959
"end": {

test/transition/transition-test-tween.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ module.exports = {
3636

3737
// The order here is a bit brittle: because the transition has zero delay,
3838
// it's invoking the start event immediately for all nodes, rather than
39-
// pushing each node onto the timer queue (which would reverse the order of
40-
// callbacks). The order in which tweens are invoked is undefined, so perhaps
41-
// we should sort the expected and actual values before comparing.
39+
// pushing each node onto the timer queue. The order in which tweens are
40+
// invoked is undefined (see #1245), so perhaps we should sort the expected
41+
// and actual values before comparing.
4242

4343
"defines the corresponding tween": function(result) {
4444
assert.typeOf(result.transition.tween("text"), "function");
@@ -47,10 +47,10 @@ module.exports = {
4747
assert.equal(result.fails, 0);
4848
},
4949
"invokes the tween function": function(result) {
50-
assert.deepEqual(result.data, ["green", "red"], "expected data, got {actual}");
51-
assert.deepEqual(result.index, [1, 0], "expected data, got {actual}");
52-
assert.domEqual(result.context[0], result.selection[0][1], "expected this, got {actual}");
53-
assert.domEqual(result.context[1], result.selection[0][0], "expected this, got {actual}");
50+
assert.deepEqual(result.data, ["red", "green"], "expected data, got {actual}");
51+
assert.deepEqual(result.index, [0, 1], "expected data, got {actual}");
52+
assert.domEqual(result.context[0], result.selection[0][0], "expected this, got {actual}");
53+
assert.domEqual(result.context[1], result.selection[0][1], "expected this, got {actual}");
5454
},
5555

5656
"end": {

0 commit comments

Comments
 (0)