piskel/test/js/service/HistoryServiceTest.js
2014-08-12 00:30:57 +02:00

22 lines
No EOL
724 B
JavaScript

describe("History Service suite", function() {
it("starts at -1", function() {
var mockPiskelController = {};
var mockShortcutService = {};
var historyService = new pskl.service.HistoryService(mockPiskelController, mockShortcutService);
expect(historyService.currentIndex).toBe(-1);
});
it("is at 0 after init", function() {
var mockPiskelController = {
serialize : function () {
return 'serialized-piskel';
}
};
var mockShortcutService = {
addShortcut : function () {}
};
var historyService = new pskl.service.HistoryService(mockPiskelController, mockShortcutService);
historyService.init();
expect(historyService.currentIndex).toBe(0);
});
});