summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/mail_view/ui/attachment_icon.spec.js
blob: c60d6f7e7b7912f12e935693f8efdef05b54f82f (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"></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);
    });

  });
});