diff options
author | Ola Bini <ola.bini@gmail.com> | 2014-07-31 19:29:33 -0300 |
---|---|---|
committer | Ola Bini <ola.bini@gmail.com> | 2014-07-31 19:29:33 -0300 |
commit | 04cf441c5ae18400c6b4865b0b37a71718dc9d46 (patch) | |
tree | dd0b0d049ec00389e2d4561b226c46eb1682b997 /web-ui/test/spec/mail_list_actions/ui | |
parent | 639a663a4c37020003586438fdcd7ac529a00f10 (diff) |
Add web-ui based on previous code
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'); + }); +}); |