diff options
Diffstat (limited to 'web-ui/test')
-rw-r--r-- | web-ui/test/spec/helpers/view_helper.spec.js | 8 | ||||
-rw-r--r-- | web-ui/test/spec/tags/data/tags.spec.js | 8 | ||||
-rw-r--r-- | web-ui/test/spec/tags/ui/tag_list.spec.js | 7 |
3 files changed, 23 insertions, 0 deletions
diff --git a/web-ui/test/spec/helpers/view_helper.spec.js b/web-ui/test/spec/helpers/view_helper.spec.js index 7b5b960b..888c6cda 100644 --- a/web-ui/test/spec/helpers/view_helper.spec.js +++ b/web-ui/test/spec/helpers/view_helper.spec.js @@ -15,6 +15,14 @@ define(['helpers/view_helper'], function (viewHelper) { expect(quotedMail).toContain('> First Line\n> Second Line'); }); + + it('should add the mail sender information', function() { + testData.rawMail.mail.textPlainBody = 'First Line\nSecond Line'; + + var quotedMail = viewHelper.quoteMail(testData.rawMail.mail); + + expect(quotedMail).toContain('On Wed Jun 04 2014 17:41:13 GMT+0000 (UTC), <laurel@hamill.info> wrote'); + }); }); describe('getFormmattedDate', function() { diff --git a/web-ui/test/spec/tags/data/tags.spec.js b/web-ui/test/spec/tags/data/tags.spec.js index 469ab0ce..53978fb8 100644 --- a/web-ui/test/spec/tags/data/tags.spec.js +++ b/web-ui/test/spec/tags/data/tags.spec.js @@ -47,4 +47,12 @@ describeComponent('tags/data/tags', function () { tags.push(this.component.all); expect(eventSpy.mostRecentCall.data).toEqual(jasmine.objectContaining({tags: tags})); }); + + it('should reload taglist on mail sent', function(){ + spyOn($, 'ajax').and.returnValue($.Deferred()); + + $(document).trigger(Pixelated.events.mail.sent); + + expect($.ajax.calls.mostRecent().args[0]).toEqual('/tags'); + }); }); diff --git a/web-ui/test/spec/tags/ui/tag_list.spec.js b/web-ui/test/spec/tags/ui/tag_list.spec.js index f92f72af..e84c68aa 100644 --- a/web-ui/test/spec/tags/ui/tag_list.spec.js +++ b/web-ui/test/spec/tags/ui/tag_list.spec.js @@ -62,6 +62,13 @@ describeComponent('tags/ui/tag_list', function () { expect(this.component.attr.currentTag).toEqual('amazing'); }); + it('should uncheck all emails when a new tag is selected', function () { + var uncheckAllEvent = spyOnEvent(document, Pixelated.events.ui.mails.uncheckAll); + $(document).trigger(Pixelated.events.ui.tag.select, { tag: 'amazing'}); + + expect(uncheckAllEvent).toHaveBeenTriggeredOn(document); + }); + it('resets the tag lists when loading tags', function () { var tagList = [tag('tag1', 1, false), tag('tag2', 2, true), tag('tag3', 3, true)]; $(document).trigger(Pixelated.events.tags.received, {tags: tagList}); |