From 50af41627871cde394017bbb139dd9b281a7f6bf Mon Sep 17 00:00:00 2001 From: Folker Bernitt Date: Mon, 2 Feb 2015 10:42:05 +0100 Subject: Added test for previous commit, delete permanently button. - Issue #20 --- .../mail_list_actions/ui/mail_list_actions.spec.js | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 web-ui/test/spec/mail_list_actions/ui/mail_list_actions.spec.js (limited to 'web-ui/test/spec/mail_list_actions/ui/mail_list_actions.spec.js') 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 = $('', { id: 'delete-selected'}); + }); + + it('should render button text', function () { + $(document).trigger(Pixelated.events.ui.tag.select, {tag: 'inbox'}); + + expect(this.component.$node.html()).toMatch('
  • '); + }); + + 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('
  • '); + }); + + 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('
  • '); + }); + }); +}); + -- cgit v1.2.3