Skip to content
Snippets Groups Projects
Unverified Commit 77732366 authored by Christoph Wurst's avatar Christoph Wurst
Browse files

Fix failing js unit test cases

parent bfe0ce75
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,7 @@ define([
});
it('does not update its attributes if progress is not computable', function() {
attachment = new LocalAttachment();
/* simulate a call to 'onProgress' with some example values */
var progressEvent = {
lengthComputable: false,
......@@ -61,9 +62,8 @@ define([
};
attachment.onProgress(progressEvent);
/* we expect the status to be 'ONGOING' and the value 0.5 (=500/1000) */
expect(attachment.get('progress')).toBe(0.5);
expect(attachment.get('uploadStatus')).toBe(1);
expect(attachment.get('progress')).toBe(0);
expect(attachment.get('uploadStatus')).toBe(0);
});
});
});
......@@ -50,7 +50,6 @@ define([
return mock;
}
beforeEach(function() {
originalNotification = window.Notification;
jasmine.clock().install();
......@@ -59,6 +58,7 @@ define([
afterEach(function() {
window.Notification = originalNotification;
jasmine.clock().uninstall();
notification = undefined;
});
it('requests notification permissions', function() {
......@@ -75,7 +75,6 @@ define([
NotificationHandler.showNotification('a', 'b');
// A new notification should have been created
expect(notification).toBe(undefined);
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment