diff options
Diffstat (limited to 'web-ui/test/spec/mail_list_actions/ui')
3 files changed, 51 insertions, 0 deletions
diff --git a/web-ui/test/spec/mail_list_actions/ui/compose_trigger.spec.js b/web-ui/test/spec/mail_list_actions/ui/compose_trigger.spec.js new file mode 100644 index 00000000..4942b5b6 --- /dev/null +++ b/web-ui/test/spec/mail_list_actions/ui/compose_trigger.spec.js @@ -0,0 +1,16 @@ +describeComponent('mail_list_actions/ui/compose_trigger', function () { + 'use strict'; + + beforeEach(function () { + setupComponent('<div></div>'); + }); + + it('triggers the enableComposebox event when clicked', function () { + var spyEvent = spyOnEvent(document, Smail.events.dispatchers.rightPane.openComposeBox); + + this.component.trigger('click'); + + expect(spyEvent).toHaveBeenTriggeredOn(document); + }); + +}); diff --git a/web-ui/test/spec/mail_list_actions/ui/mail_actions.spec.js b/web-ui/test/spec/mail_list_actions/ui/mail_actions.spec.js new file mode 100644 index 00000000..f7a0ed72 --- /dev/null +++ b/web-ui/test/spec/mail_list_actions/ui/mail_actions.spec.js @@ -0,0 +1,9 @@ +describeComponent('mail_list_actions/ui/mail_actions', function () { + 'use strict'; + + beforeEach(function () { + setupComponent(); + }); + + +}); diff --git a/web-ui/test/spec/mail_list_actions/ui/pagination_trigger.spec.js b/web-ui/test/spec/mail_list_actions/ui/pagination_trigger.spec.js new file mode 100644 index 00000000..67c2f3ef --- /dev/null +++ b/web-ui/test/spec/mail_list_actions/ui/pagination_trigger.spec.js @@ -0,0 +1,26 @@ +describeComponent('mail_list_actions/ui/pagination_trigger', function () { + 'use strict'; + + beforeEach(function () { + setupComponent(); + }); + + it('triggers the ui:page:previous event when the left arrow is clicked', function () { + var eventSpy = spyOnEvent(document, Smail.events.ui.page.previous); + this.component.select('previous').click(); + expect(eventSpy).toHaveBeenTriggeredOn(document); + }); + + + it('triggers the ui:page:next event when the right arrow is clicked', function () { + var eventSpy = spyOnEvent(document, Smail.events.ui.page.next); + this.component.select('next').click(); + expect(eventSpy).toHaveBeenTriggeredOn(document); + }); + + it('re-renders with current page number when page changes', function () { + this.component.trigger(document, Smail.events.ui.page.changed, {currentPage: 0}); + + expect(this.component.select('currentPage').text()).toBe('1'); + }); +}); |