Add test for Document#activate()

This commit is contained in:
Jonathan Puckey 2011-02-12 18:07:14 +01:00
parent c0e2101c32
commit b261fafd32
2 changed files with 11 additions and 0 deletions

View file

@ -26,6 +26,7 @@
<script type="text/javascript" src="tests/Point.js"></script>
<script type="text/javascript" src="tests/Size.js"></script>
<script type="text/javascript" src="tests/Rectangle.js"></script>
<script type="text/javascript" src="tests/Document.js"></script>
<script type="text/javascript" src="tests/Item.js"></script>
<script type="text/javascript" src="tests/Segment.js"></script>
<script type="text/javascript" src="tests/Path.js"></script>

10
test/tests/Document.js Normal file
View file

@ -0,0 +1,10 @@
module('Document');
test('activate()', function() {
var doc = new Doc();
var secondDoc = new Doc();
doc.activate();
var path = new Path();
equals(doc.activeLayer.children[0] == path, true);
equals(secondDoc.activeLayer.children.length == 0, true);
});