summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/mail_view/ui/draft_save_status.spec.js
blob: 0db823d9e70a212758d6892ef693203c69ef2871 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
describeComponent('mail_view/ui/draft_save_status', function () {
  'use strict';

  beforeEach(this.setupComponent);

  it('should be empty on initialization', function() {
    expect(this.$node.text()).toBe('');
  });

  it('should display status when saving a draft', function() {
    $(document).trigger(Pixelated.events.mail.saveDraft);
    expect(this.$node.text()).toBe('Saving to Drafts...');
  });

  it('should display status when draft is saved', function() {
    $(document).trigger(Pixelated.events.mail.draftSaved);
    expect(this.$node.text()).toBe('Draft Saved.');
  });

  it('should reset status when mail is changed since last save', function() {
    $(document).trigger(Pixelated.events.ui.mail.changedSinceLastSave);
    expect(this.$node.text()).toBe('');
  });
});