summaryrefslogtreecommitdiff
path: root/web-ui/test
diff options
context:
space:
mode:
authorThais Siqueira <thais.siqueira@gmail.com>2016-04-11 08:54:03 -0300
committerThais Siqueira <thais.siqueira@gmail.com>2016-04-11 08:54:03 -0300
commit3f9c038772f7fd4987e053c9188e260f5f55f07b (patch)
treeb89b0f505ae91c076d9f7bf03ea9dd50e597c948 /web-ui/test
parent1bdad5bcf1742b279ba0a2840aec526e4f6175a7 (diff)
parentf41cea02299dc41dcc1f934d57430b564cf708ef (diff)
Merge branch 'dev/622-hide-reply-container'
Diffstat (limited to 'web-ui/test')
-rw-r--r--web-ui/test/spec/mail_view/ui/mail_view.spec.js6
-rw-r--r--web-ui/test/spec/mixins/with_mail_sandbox.spec.js38
2 files changed, 38 insertions, 6 deletions
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..daa8cc39
--- /dev/null
+++ b/web-ui/test/spec/mixins/with_mail_sandbox.spec.js
@@ -0,0 +1,38 @@
+describeMixin('mixins/with_mail_sandbox', function() {
+ 'use strict';
+
+ beforeEach(function() {
+ this.setupComponent('<iframe id="read-sandbox" sandbox="allow-popups allow-scripts" src scrolling="no"></iframe>');
+ var iframe = document.querySelector('iframe');
+ var template = ['',
+ '<!DOCTYPE html>',
+ '<html>',
+ '<head>',
+ '<meta charset="utf-8">',
+ '<script>(function () {',
+ '\'use strict\'',
+ ';window.onmessage = function (e) {',
+ 'if (e.data.html) {',
+ 'var mainWindow = e.source;',
+ 'mainWindow.postMessage(\'data ok\', e.origin);',
+ '}',
+ '};',
+ '})();',
+ '</script>',
+ '</head>',
+ '<body>',
+ '</body>',
+ '</html>'].join('');
+ iframe.src = URL.createObjectURL(new Blob([template], {type: "text/html"}));
+ });
+
+ it('should open reply container', function (done) {
+ var showContainerEvent = spyOnEvent(document, Pixelated.events.ui.replyBox.showReplyContainer);
+ this.component.showMailOnSandbox(Pixelated.testData().parsedMail.html);
+ setTimeout(function() {
+ expect(showContainerEvent).toHaveBeenTriggeredOn(document);
+ done();
+ }, 200);
+ });
+
+});