tests update

This commit is contained in:
jdescottes
2014-08-12 00:30:57 +02:00
parent 05e8f9adac
commit 6d6e80c762
2 changed files with 24 additions and 13 deletions

View File

@ -1,8 +1,22 @@
describe("History Service suite", function() {
it("contains spec with an expectation", function() {
it("starts at -1", function() {
var mockPiskelController = {};
var historyService = new pskl.service.HistoryService(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);
});
});