summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/mail_view/ui/attachment_icon.spec.js
diff options
context:
space:
mode:
authorNavaL <mnandri@thoughtworks.com>2016-01-05 15:10:33 +0100
committerNavaL <mnandri@thoughtworks.com>2016-01-05 19:45:38 +0100
commit0ca01a8a8e2cd9201f43fa840a30a0822215bfef (patch)
tree2cb37ab0055f39a2d3ef384cceb6a75f5b47e977 /web-ui/test/spec/mail_view/ui/attachment_icon.spec.js
parent29bfdd509d88aef16873207683302bec22bfe5a9 (diff)
separated attachment list UI as a component and the corresponding attachment list payload as a mixin
Issue #548
Diffstat (limited to 'web-ui/test/spec/mail_view/ui/attachment_icon.spec.js')
-rw-r--r--web-ui/test/spec/mail_view/ui/attachment_icon.spec.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/web-ui/test/spec/mail_view/ui/attachment_icon.spec.js b/web-ui/test/spec/mail_view/ui/attachment_icon.spec.js
new file mode 100644
index 00000000..d29660b9
--- /dev/null
+++ b/web-ui/test/spec/mail_view/ui/attachment_icon.spec.js
@@ -0,0 +1,21 @@
+describeComponent('mail_view/ui/attachment_icon', function () {
+ 'use strict';
+
+ describe('attachment', function () {
+ beforeEach(function () {
+ Pixelated.mockBloodhound();
+ this.setupComponent();
+ });
+
+ it('should render attachment button if feature enabled', function () {
+ expect(this.$node.html()).toMatch('<i class="fa fa-paperclip fa-2x"></i>');
+ });
+
+ it('should trigger starts of attachment upload process', function () {
+ var triggerUploadAttachment = spyOnEvent(document, Pixelated.events.mail.startUploadAttachment);
+ this.$node.click();
+ expect(triggerUploadAttachment).toHaveBeenTriggeredOn(document);
+ });
+
+ });
+});