summaryrefslogtreecommitdiff
path: root/web-ui
diff options
context:
space:
mode:
authorJefferson Stachelski <jeffhsta@riseup.net>2015-07-28 19:03:58 -0300
committerJefferson Stachelski <jeffhsta@riseup.net>2015-07-28 19:03:58 -0300
commit3dfa4b9db8da54c1f64edb9bcb01ec0d4a1d3f70 (patch)
treea1e09d45ecd8f634eeab3288f4263808c0f25637 /web-ui
parent6cba38db104dbbedc7c0f29b22c242ac43a75bcd (diff)
#407 wrote JS tests for the merged pull request
Diffstat (limited to 'web-ui')
-rw-r--r--web-ui/test/spec/mail_view/ui/compose_box.spec.js9
-rw-r--r--web-ui/test/spec/mail_view/ui/draft_box.spec.js10
2 files changed, 19 insertions, 0 deletions
diff --git a/web-ui/test/spec/mail_view/ui/compose_box.spec.js b/web-ui/test/spec/mail_view/ui/compose_box.spec.js
index 414bc022..2fe3b982 100644
--- a/web-ui/test/spec/mail_view/ui/compose_box.spec.js
+++ b/web-ui/test/spec/mail_view/ui/compose_box.spec.js
@@ -99,6 +99,15 @@ describeComponent('mail_view/ui/compose_box', function () {
expect(openNoMessageSelectedPaneEvent).not.toHaveBeenTriggeredOn(document);
});
+
+ it('should call the enableFloatlabel method when events.mail.here is trigged', function() {
+ spyOn(this.component, 'enableFloatlabel');
+
+ this.component.renderComposeBox();
+
+ expect(this.component.enableFloatlabel).toHaveBeenCalledWith('input.floatlabel');
+ expect(this.component.enableFloatlabel).toHaveBeenCalledWith('textarea.floatlabel');
+ });
});
describe('close button behavior', function() {
diff --git a/web-ui/test/spec/mail_view/ui/draft_box.spec.js b/web-ui/test/spec/mail_view/ui/draft_box.spec.js
index 0113ca01..03098018 100644
--- a/web-ui/test/spec/mail_view/ui/draft_box.spec.js
+++ b/web-ui/test/spec/mail_view/ui/draft_box.spec.js
@@ -65,4 +65,14 @@ describeComponent('mail_view/ui/draft_box', function () {
expect(openNoMessageSelectedEvent).toHaveBeenTriggeredOn(document);
});
+ it('should call the enableFloatlabel method when events.mail.here is trigged', function() {
+ this.setupComponent({mailIdent: mail.ident});
+ spyOn(this.component, 'enableFloatlabel');
+
+ this.component.trigger(this.component, Pixelated.events.mail.here, { mail: mail });
+
+ expect(this.component.enableFloatlabel).toHaveBeenCalledWith('input.floatlabel');
+ expect(this.component.enableFloatlabel).toHaveBeenCalledWith('textarea.floatlabel');
+ });
+
});