diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-02-02 10:42:05 +0100 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-02-02 10:42:42 +0100 |
commit | 50af41627871cde394017bbb139dd9b281a7f6bf (patch) | |
tree | cf8095940e49ab634de20850e51c8f5201d6ef0c /web-ui/test/spec/mail_list_actions | |
parent | 86ff3e0f99b979c63df3e7d75a5101389e2d060e (diff) |
Added test for previous commit, delete permanently button.
- Issue #20
Diffstat (limited to 'web-ui/test/spec/mail_list_actions')
-rw-r--r-- | web-ui/test/spec/mail_list_actions/ui/mail_list_actions.spec.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/web-ui/test/spec/mail_list_actions/ui/mail_list_actions.spec.js b/web-ui/test/spec/mail_list_actions/ui/mail_list_actions.spec.js new file mode 100644 index 00000000..7f7ba64a --- /dev/null +++ b/web-ui/test/spec/mail_list_actions/ui/mail_list_actions.spec.js @@ -0,0 +1,33 @@ +describeComponent('mail_list_actions/ui/mail_list_actions', function () { + 'use strict'; + var mailListActionsContainer; + + describe('post initialization', function () { + beforeEach(function () { + this.setupComponent(); + mailListActionsContainer = $('<input>', { id: 'delete-selected'}); + }); + + it('should render button text', function () { + $(document).trigger(Pixelated.events.ui.tag.select, {tag: 'inbox'}); + + expect(this.component.$node.html()).toMatch('<li><input type="button" id="delete-selected" value="Delete" disabled="disabled"></li>'); + }); + + it('should render button text delete permanently if tag trash', function () { + $(document).trigger(Pixelated.events.ui.tag.select, {tag: 'trash'}); + + expect(this.component.$node.html()).toMatch('<li><input type="button" id="delete-selected" value="Delete permanently" disabled="disabled"></li>'); + }); + + it('should render button delete permanently if url contains trash tag', function () { + var urlParams = require('page/router/url_params'); + spyOn(urlParams, 'getTag').and.returnValue('trash'); + + this.setupComponent(); + + expect(this.component.$node.html()).toMatch('<li><input type="button" id="delete-selected" value="Delete permanently" disabled="disabled"></li>'); + }); + }); +}); + |