[Persistence] Complete tests for queue

Complete tests for platform/persistence/queue, WTD-1033.
This commit is contained in:
Victor Woeltjen
2015-03-25 11:36:43 -07:00
parent 74fecf5271
commit 29584f2a7e
2 changed files with 72 additions and 0 deletions

View File

@@ -7,6 +7,28 @@ define(
"use strict";
describe("The persistence queue", function () {
var mockQ,
mockTimeout,
mockDialogService,
queue;
beforeEach(function () {
mockQ = jasmine.createSpyObj("$q", ['defer']);
mockTimeout = jasmine.createSpy("$timeout");
mockDialogService = jasmine.createSpyObj(
'dialogService',
['getUserChoice']
);
queue = new PersistenceQueue(mockQ, mockTimeout, mockDialogService);
});
// PersistenceQueue is just responsible for handling injected
// dependencies and wiring the PersistenceQueueImpl and its
// handlers. Functionality is tested there, so our test here is
// minimal (get back expected interface, no exceptions)
it("provides a queue with a put method", function () {
expect(queue.put).toEqual(jasmine.any(Function));
});
});
}