summaryrefslogtreecommitdiff
path: root/web-ui/test
diff options
context:
space:
mode:
authorNavaL <mnandri@thoughtworks.com>2016-01-11 18:37:03 +0100
committerNavaL <mnandri@thoughtworks.com>2016-01-11 18:37:03 +0100
commitc28bdb520cc4ea1249d5a2953d9f78d40dd10806 (patch)
treedcf9fd931785d27c966b6cecbcc389c8abbb0d9b /web-ui/test
parent0c6c8bed304884ab5f3ade69fb0d68d2cbe043e6 (diff)
auto save draft on adding attachment, within timeout
Issue #573
Diffstat (limited to 'web-ui/test')
-rw-r--r--web-ui/test/spec/mixins/with_mail_edit_base.spec.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/web-ui/test/spec/mixins/with_mail_edit_base.spec.js b/web-ui/test/spec/mixins/with_mail_edit_base.spec.js
index 2b35d4f5..4ff02318 100644
--- a/web-ui/test/spec/mixins/with_mail_edit_base.spec.js
+++ b/web-ui/test/spec/mixins/with_mail_edit_base.spec.js
@@ -48,6 +48,18 @@ describeMixin('mixins/with_mail_edit_base', function () {
}, 10);
});
+ it('saves the draft when an attachment is added within timeout', function(done) {
+ var saveDraftSpy = spyOnEvent(document, Pixelated.events.mail.saveDraft);
+ this.component.enableAutoSave();
+ this.component.trigger(document, Pixelated.events.mail.appendAttachment);
+ expect(saveDraftSpy).not.toHaveBeenTriggeredOn(document);
+
+ setTimeout(function () {
+ expect(saveDraftSpy).toHaveBeenTriggeredOn(document);
+ done();
+ }, 10);
+ });
+
it('does not save if mail is sent before the save draft interval number of seconds', function(done) {
var saveDraftSpy = spyOnEvent(document, Pixelated.events.mail.saveDraft);
this.component.monitorInput();