From b512200aef602afba340321a2ae89fa9293dde73 Mon Sep 17 00:00:00 2001 From: Caio Carrara Date: Tue, 29 Mar 2016 18:09:03 -0300 Subject: Issue #622 - hide reply buttons It changes the trigger of event which show the reply container to after the iframe received the message with email body. --- web-ui/test/spec/mail_view/ui/mail_view.spec.js | 6 ------ web-ui/test/spec/mixins/with_mail_sandbox.spec.js | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 web-ui/test/spec/mixins/with_mail_sandbox.spec.js (limited to 'web-ui/test/spec') diff --git a/web-ui/test/spec/mail_view/ui/mail_view.spec.js b/web-ui/test/spec/mail_view/ui/mail_view.spec.js index 850687be..f44d71ee 100644 --- a/web-ui/test/spec/mail_view/ui/mail_view.spec.js +++ b/web-ui/test/spec/mail_view/ui/mail_view.spec.js @@ -35,12 +35,6 @@ describeComponent('mail_view/ui/mail_view', function () { expect(openNoMessageSelectedEvent).toHaveBeenTriggeredOn(document); }); - it('should open reply container', function () { - var showContainerEvent = spyOnEvent(document, Pixelated.events.ui.replyBox.showReplyContainer); - this.component.displayMail({}, testData); - expect(showContainerEvent).toHaveBeenTriggeredOn(document); - }); - it('removes the tag from the mail when the tag label is clicked', function() { var updateSpy = spyOnEvent(document, Pixelated.events.mail.tags.update); diff --git a/web-ui/test/spec/mixins/with_mail_sandbox.spec.js b/web-ui/test/spec/mixins/with_mail_sandbox.spec.js new file mode 100644 index 00000000..7f5c39a3 --- /dev/null +++ b/web-ui/test/spec/mixins/with_mail_sandbox.spec.js @@ -0,0 +1,14 @@ +describeMixin('mixins/with_mail_sandbox', function() { + 'use strict'; + + beforeEach(function() { + this.setupComponent(); + }); + + it('should open reply container', function () { + var showContainerEvent = spyOnEvent(document, Pixelated.events.ui.replyBox.showReplyContainer); + this.component.showMailOnSandbox(Pixelated.testData().parsedMail.html); + expect(showContainerEvent).toHaveBeenTriggeredOn(document); + }); + +}); -- cgit v1.2.3 From 43377bd550183a404d387d297d6f610697388114 Mon Sep 17 00:00:00 2001 From: Felix Hammerl Date: Wed, 30 Mar 2016 17:41:43 +0200 Subject: Set up component test with minimal DOM --- web-ui/test/spec/mixins/with_mail_sandbox.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web-ui/test/spec') diff --git a/web-ui/test/spec/mixins/with_mail_sandbox.spec.js b/web-ui/test/spec/mixins/with_mail_sandbox.spec.js index 7f5c39a3..a1c2d624 100644 --- a/web-ui/test/spec/mixins/with_mail_sandbox.spec.js +++ b/web-ui/test/spec/mixins/with_mail_sandbox.spec.js @@ -2,7 +2,7 @@ describeMixin('mixins/with_mail_sandbox', function() { 'use strict'; beforeEach(function() { - this.setupComponent(); + this.setupComponent(''); }); it('should open reply container', function () { -- cgit v1.2.3 From f41cea02299dc41dcc1f934d57430b564cf708ef Mon Sep 17 00:00:00 2001 From: Felix Hammerl Date: Fri, 1 Apr 2016 14:51:27 +0200 Subject: Run event test async with source passed to iframe via Blob URI --- web-ui/test/spec/mixins/with_mail_sandbox.spec.js | 30 ++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'web-ui/test/spec') diff --git a/web-ui/test/spec/mixins/with_mail_sandbox.spec.js b/web-ui/test/spec/mixins/with_mail_sandbox.spec.js index a1c2d624..daa8cc39 100644 --- a/web-ui/test/spec/mixins/with_mail_sandbox.spec.js +++ b/web-ui/test/spec/mixins/with_mail_sandbox.spec.js @@ -2,13 +2,37 @@ describeMixin('mixins/with_mail_sandbox', function() { 'use strict'; beforeEach(function() { - this.setupComponent(''); + this.setupComponent(''); + var iframe = document.querySelector('iframe'); + var template = ['', + '', + '', + '', + '', + '', + '', + '', + '', + ''].join(''); + iframe.src = URL.createObjectURL(new Blob([template], {type: "text/html"})); }); - it('should open reply container', function () { + it('should open reply container', function (done) { var showContainerEvent = spyOnEvent(document, Pixelated.events.ui.replyBox.showReplyContainer); this.component.showMailOnSandbox(Pixelated.testData().parsedMail.html); - expect(showContainerEvent).toHaveBeenTriggeredOn(document); + setTimeout(function() { + expect(showContainerEvent).toHaveBeenTriggeredOn(document); + done(); + }, 200); }); }); -- cgit v1.2.3