0740d4762f
* 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
29 lines
789 B
JavaScript
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);
|
|
});
|
|
});
|