Added test for notification to CopyActionSpec

This commit is contained in:
Andrew Henry
2015-11-04 20:12:36 -08:00
parent 7d1a1acc11
commit 529dde57b9
2 changed files with 14 additions and 13 deletions

View File

@@ -46,7 +46,8 @@ define(
notification,
dialogService,
mockLog,
abstractComposePromise;
abstractComposePromise,
progress = {phase: "copying", totalObjects: 10, processed: 1};
beforeEach(function () {
selectedObjectContextCapability = jasmine.createSpyObj(
@@ -100,7 +101,7 @@ define(
);
abstractComposePromise.then.andCallFake(function(success, error, notify){
notify({phase: "copying", totalObjects: 10, processed: 10});
notify(progress);
success();
}
)
@@ -115,23 +116,23 @@ define(
.andReturn(locationServicePromise);
dialogService = jasmine.createSpyObj('dialogService',
['showBlockingMessage']
['showBlockingMessage', 'dismiss']
);
dialogService.showBlockingMessage.andReturn();
//dialogService.showBlockingMessage.andReturn();
notification = jasmine.createSpyObj('notification',
['dismiss', 'model']
);
notification.dismiss.andReturn();
//notification.dismiss.andReturn();
notificationService = jasmine.createSpyObj('notificationService',
['notify']
['notify', 'info']
);
notificationService.notify.andReturn(notification);
mockLog = jasmine.createSpyObj('log', ['error']);
mockLog.error.andReturn();
//mockLog.error.andReturn();
copyService = new MockCopyService();
});
@@ -189,7 +190,7 @@ define(
});
it("notifies the user of progress", function(){
expect(copyAction.progress.calls.length).toBeGreaterThan(0)
expect(notificationService.info).toHaveBeenCalled();
});
});