           ['bar', 'baz']
         ]
 
+        table.clearUndoStack()
+
         cell = table.cellAtPosition([0, 0])
 
         cell.setValue 'hello'
 
         table.undo()
 
-        expect(table.undoStack.length).toEqual(3)
+        expect(table.undoStack.length).toEqual(0)
         expect(table.redoStack.length).toEqual(1)
 
         expect(cell.getValue()).toEqual('foo')
 
         table.redo()
 
-        expect(table.undoStack.length).toEqual(4)
+        expect(table.undoStack.length).toEqual(1)
         expect(table.redoStack.length).toEqual(0)
 
         expect(cell.getValue()).toEqual('hello')

          ['bar', 'baz']
        ]

        row = table.getRow(0)
        row.height = 100

        table.undo()

        expect(table.undoStack.length).toEqual(3)
        expect(table.redoStack.length).toEqual(1)

        expect(row.height).toEqual(undefined)

        table.redo()

        expect(table.undoStack.length).toEqual(4)
        expect(table.redoStack.length).toEqual(0)

        expect(row.height).toEqual(100)

        column = table.addColumn('value', default: 'empty')

      it 'rolls back a row addition', ->
        table.clearUndoStack()

        row = table.addRow ['foo', 'bar'], height: 100

        table.undo()

        expect(table.getRowsCount()).toEqual(0)
        expect(table.undoStack.length).toEqual(0)
        expect(table.redoStack.length).toEqual(1)

        table.redo()

        expect(table.undoStack.length).toEqual(1)
        expect(table.redoStack.length).toEqual(0)
        expect(table.getRowsCount()).toEqual(1)
        expect(table.getRow(0).key).toEqual('foo')
