blob: d8917ed9b0294e9b8b39b89d33a5b70c4ce7dd39 (
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
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>');
});
it('should render move to inbox if on trash', 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="recover-selected" value="Move to Inbox" disabled="disabled"></li>');
});
it('should not render move to inbox if on trash', function () {
var urlParams = require('page/router/url_params');
spyOn(urlParams, 'getTag').and.returnValue('inbox');
this.setupComponent();
expect(this.component.$node.html()).not.toMatch('<li><input type="button" id="recover-selected" value="Move to Inbox" disabled="disabled"></li>');
});
});
});
|