2 * @author lxxxvi / https://github.com/lxxxvi
3 * Developed as part of a project at University of Applied Sciences and Arts Northwestern Switzerland (www.fhnw.ch)
6 QUnit.module( "NegativeCases" );
8 QUnit.test( "Test unwanted situations ", function( assert ) {
10 var editor = new Editor();
14 assert.ok( editor.history.undos.length == 0, "OK, (illegal) undo did not affect the undo history" );
15 assert.ok( editor.history.redos.length == 0, "OK, (illegal) undo did not affect the redo history" );
19 assert.ok( editor.history.undos.length == 0, "OK, (illegal) redo did not affect the undo history" );
20 assert.ok( editor.history.redos.length == 0, "OK, (illegal) redo did not affect the redo history" );
24 var cmd = new AddObjectCommand( box );
25 cmd.updatable = false;
26 editor.execute( cmd );
28 assert.ok( editor.history.undos.length == 1, "OK, execute changed undo history" );
29 assert.ok( editor.history.redos.length == 0, "OK, execute did not change redo history" );
33 assert.ok( editor.history.undos.length == 1, "OK, (illegal) redo did not affect the undo history" );
34 assert.ok( editor.history.redos.length == 0, "OK, (illegal) redo did not affect the redo history" );
38 assert.ok( editor.history.undos.length == 0, "OK, undo changed the undo history" );
39 assert.ok( editor.history.redos.length == 1, "OK, undo changed the redo history" );
43 assert.ok( editor.history.undos.length == 0, "OK, (illegal) undo did not affect the undo history" );
44 assert.ok( editor.history.redos.length == 1, "OK, (illegal) undo did not affect the redo history" );
47 assert.ok( editor.history.undos.length == 1, "OK, redo changed the undo history" );
48 assert.ok( editor.history.redos.length == 0, "OK, undo changed the redo history" );
52 assert.ok( editor.history.undos.length == 1, "OK, (illegal) did not affect the undo history" );
53 assert.ok( editor.history.redos.length == 0, "OK, (illegal) did not affect the redo history" );