summaryrefslogtreecommitdiff
path: root/test/09-test-undo.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/09-test-undo.js')
-rw-r--r--test/09-test-undo.js27
1 files changed, 14 insertions, 13 deletions
diff --git a/test/09-test-undo.js b/test/09-test-undo.js
index 84b5d09..60fbbb6 100644
--- a/test/09-test-undo.js
+++ b/test/09-test-undo.js
@@ -1,5 +1,6 @@
var assert = require("assert")
-var UndoStack = require("../public/assets/javascripts/rectangles/util/undo.js")
+var UndoStack = require("../public/assets/javascripts/rectangles/util/undostack.js")
+UndoStack.debug = false
describe('undo', function(){
@@ -9,11 +10,11 @@ describe('undo', function(){
UndoStack.register({
type: "demo",
- undo: function(action){
- state = action.prev
+ undo: function(myState){
+ state = myState
},
- redo: function(action){
- state = action.next
+ redo: function(myState){
+ state = myState
},
})
@@ -33,22 +34,22 @@ describe('undo', function(){
UndoStack.push({
type: "demo",
- prev: state,
- next: "one"
+ undo: state,
+ redo: "one"
})
state = "one"
UndoStack.push({
type: "demo",
- prev: state,
- next: "two"
+ undo: state,
+ redo: "two"
})
state = "two"
UndoStack.push({
type: "demo",
- prev: state,
- next: "three"
+ undo: state,
+ redo: "three"
})
state = "three"
@@ -122,8 +123,8 @@ describe('undo', function(){
UndoStack.push({
type: "demo",
- prev: state,
- next: "four"
+ undo: state,
+ redo: "four"
})
state = "four"