Skip to content

Commit f50e28c

Browse files
committed
Add more Layer tests.
1 parent f6e827c commit f50e28c

1 file changed

Lines changed: 15 additions & 16 deletions

File tree

test/tests/Layer.js

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,28 +75,27 @@ test('appendTop / appendBottom / nesting', function() {
7575
// There should be two layers now in project.layers
7676
equals(function() {
7777
return project.layers.length;
78-
}, 1);
78+
}, 2);
7979
firstLayer.appendTop(secondLayer);
8080
equals(function() {
8181
return secondLayer.parent == firstLayer;
8282
}, true);
83+
// There should only be the firsLayer now in project.layers
8384
equals(function() {
84-
return secondLayer.nextSibling == firstLayer;
85-
}, true);
86-
87-
var path = new Path();
88-
firstLayer.appendTop(path);
89-
90-
// move the layer above the path, inside the firstLayer:
91-
secondLayer.moveAbove(path);
92-
equals(function() {
93-
return secondLayer.previousSibling == path;
94-
}, true);
85+
return project.layers.length;
86+
}, 1);
9587
equals(function() {
96-
return secondLayer.parent == firstLayer;
88+
return project.layers[0] == firstLayer;
9789
}, true);
98-
// There should now only be one layer left:
90+
// Now move secondLayer bellow the first again, in which case it should
91+
// reappear in project.layers
92+
secondLayer.moveBelow(firstLayer);
93+
// There should be two layers now in project.layers again now
9994
equals(function() {
10095
return project.layers.length;
101-
}, 1);
102-
});
96+
}, 2);
97+
equals(function() {
98+
return project.layers[0] == firstLayer
99+
&& project.layers[1] == secondLayer;
100+
}, true);
101+
);

0 commit comments

Comments
 (0)