Chatwoot/app/javascript/dashboard/store/modules/specs/conversationPage/getters.spec.js
Pranav Raj S 0740d4762f
Enhancement: Paginate conversation calls in tabs (#560)
* Use conversationPage module for pagination

* Load more conversations

* Reset list if conversation status is changed

* Add specs to conversationPage

* Reset filter when page is re-mounted

* Update text

* Update text
2020-02-26 21:15:01 +05:30

29 lines
789 B
JavaScript

import { getters } from '../../conversationPage';
describe('#getters', () => {
it('getCurrentPage', () => {
const state = {
currentPage: {
me: 1,
unassigned: 2,
all: 3,
},
};
expect(getters.getCurrentPage(state)('me')).toEqual(1);
expect(getters.getCurrentPage(state)('unassigned')).toEqual(2);
expect(getters.getCurrentPage(state)('all')).toEqual(3);
});
it('getCurrentPage', () => {
const state = {
hasEndReached: {
me: false,
unassigned: true,
all: false,
},
};
expect(getters.getHasEndReached(state)('me')).toEqual(false);
expect(getters.getHasEndReached(state)('unassigned')).toEqual(true);
expect(getters.getHasEndReached(state)('all')).toEqual(false);
});
});