summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/mail_view/ui/draft_save_status.spec.js
blob: 0e428066a5a0ca7b5050e108b70ef6c89498a833 (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
25
26
/* global Pixelated */

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('');
  });
});