blob: 67c2f3ef51c531a72286a07ac006ee390725edb5 (
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
|
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');
});
});
|