Merge pull request #16 from totophe/master

Add unit tests for new function
This commit is contained in:
Oliver Sartun 2015-03-26 14:14:28 +01:00
commit e2eb4feffa

View File

@ -52,10 +52,14 @@ test("Start and stop tracking", function () {
model.set("hello", "world"); model.set("hello", "world");
collection.add({"e": "f"}); collection.add({"e": "f"});
strictEqual(UndoManager.stack.length, before, "Actions weren't added to the stack, because tracking hasn't strated yet"); strictEqual(UndoManager.stack.length, before, "Actions weren't added to the stack, because tracking hasn't started yet");
ok(!UndoManager.isTracking(), "Tracking has not started yet");
UndoManager.startTracking(); UndoManager.startTracking();
ok(UndoManager.isTracking(), "Tracking has now started");
model.set("hello", "you"); model.set("hello", "you");
collection.remove(collection.last()); collection.remove(collection.last());