summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/mail_view/ui/attachment.spec.js
blob: d29660b9515bfcb705aceb2f0cc5224929fa067e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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);
    });

  });
});