From 495bc391e140cc2bb462c81fa90410a0fe8f6a4c Mon Sep 17 00:00:00 2001 From: Duda Dornelles Date: Mon, 20 Oct 2014 12:17:18 +0200 Subject: massive update of bower and npm libs - includes flight, jasmine and a bunch of stuff. If things get weird when developing, remove you bower_components and your node_modules and install it again --- .../test/spec/mixins/with_mail_edit_base.spec.js | 32 ++++++++++------------ 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'web-ui/test/spec/mixins') diff --git a/web-ui/test/spec/mixins/with_mail_edit_base.spec.js b/web-ui/test/spec/mixins/with_mail_edit_base.spec.js index f62c1f75..9f1b47d4 100644 --- a/web-ui/test/spec/mixins/with_mail_edit_base.spec.js +++ b/web-ui/test/spec/mixins/with_mail_edit_base.spec.js @@ -7,7 +7,7 @@ describeMixin('mixins/with_mail_edit_base', function () { 'use strict'; beforeEach(function () { - setupComponent(); + this.setupComponent(); // Stubing mixing wrongly!!! 'deprecated' while waiting for draft component extraction this.component.buildMail = function (tag) { return { header: { to: ['a@smth.com'], from: 'b@smth.com', subject: 'Sbject' } }; @@ -34,28 +34,26 @@ describeMixin('mixins/with_mail_edit_base', function () { this.component.attr.saveDraftInterval = 10; }); - it('saves the draft after the save draft interval number of seconds', function() { + it('saves the draft after the save draft interval number of seconds', function(done) { var saveDraftSpy = spyOnEvent(document, Pixelated.events.mail.saveDraft); - runs(function () { - this.component.monitorInput(); - expect(saveDraftSpy).not.toHaveBeenTriggeredOn(document); - }); - waits(10); - runs(function () { + this.component.monitorInput(); + expect(saveDraftSpy).not.toHaveBeenTriggeredOn(document); + + setTimeout(function () { expect(saveDraftSpy).toHaveBeenTriggeredOn(document); - }); + done() + }, 10); }); - it('does not save if mail is sent before the save draft interval number of seconds', function() { + it('does not save if mail is sent before the save draft interval number of seconds', function(done) { var saveDraftSpy = spyOnEvent(document, Pixelated.events.mail.saveDraft); - runs(function () { - this.component.monitorInput(); - this.component.sendMail(); - }); - waits(10); - runs(function () { + this.component.monitorInput(); + this.component.sendMail(); + + setTimeout(function () { expect(saveDraftSpy).not.toHaveBeenTriggeredOn(document); - }); + done(); + }, 10); }); }); -- cgit v1.2.3