Add some tests for ChangeElementCommand by adambender from issue 936
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2079 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
@@ -439,7 +439,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Test ChangeElementCommand', function() {
|
test('Test ChangeElementCommand', function() {
|
||||||
expect(20);
|
expect(26);
|
||||||
|
|
||||||
setUp();
|
setUp();
|
||||||
|
|
||||||
@@ -510,6 +510,21 @@
|
|||||||
change.apply();
|
change.apply();
|
||||||
equals(justCalled, 'setHref');
|
equals(justCalled, 'setHref');
|
||||||
|
|
||||||
|
var line = document.createElementNS(svgns,'line');
|
||||||
|
line.setAttributeNS(null, 'class', 'newClass');
|
||||||
|
change = new svgedit.history.ChangeElementCommand(line,{class:'oldClass'});
|
||||||
|
|
||||||
|
ok(change.unapply);
|
||||||
|
ok(change.apply);
|
||||||
|
equals(typeof change.unapply, typeof function(){});
|
||||||
|
equals(typeof change.apply, typeof function(){});
|
||||||
|
|
||||||
|
change.unapply();
|
||||||
|
equals(line.getAttributeNS(null, 'class'), 'oldClass');
|
||||||
|
|
||||||
|
change.apply();
|
||||||
|
equals(line.getAttributeNS(null, 'class'), 'newClass');
|
||||||
|
|
||||||
tearDown();
|
tearDown();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -571,5 +586,6 @@
|
|||||||
<div id='div4' style='visibility:hidden'>
|
<div id='div4' style='visibility:hidden'>
|
||||||
<div id='div5'></div>
|
<div id='div5'></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user