2020-02-26 15:45:01 +00:00
|
|
|
import { getters } from '../../conversationPage';
|
|
|
|
|
|
|
|
describe('#getters', () => {
|
|
|
|
it('getCurrentPage', () => {
|
|
|
|
const state = {
|
|
|
|
currentPage: {
|
|
|
|
me: 1,
|
|
|
|
unassigned: 2,
|
|
|
|
all: 3,
|
|
|
|
},
|
|
|
|
};
|
2021-04-22 08:28:04 +00:00
|
|
|
expect(getters.getCurrentPage(state)).toHaveProperty('me');
|
|
|
|
expect(getters.getCurrentPage(state)).toHaveProperty('unassigned');
|
|
|
|
expect(getters.getCurrentPage(state)).toHaveProperty('all');
|
2020-02-26 15:45:01 +00:00
|
|
|
});
|
|
|
|
|
2021-04-22 08:28:04 +00:00
|
|
|
it('getCurrentPageFilter', () => {
|
|
|
|
const state = {
|
|
|
|
currentPage: {
|
|
|
|
me: 1,
|
|
|
|
unassigned: 2,
|
|
|
|
all: 3,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
expect(getters.getCurrentPageFilter(state)('me')).toEqual(1);
|
|
|
|
expect(getters.getCurrentPageFilter(state)('unassigned')).toEqual(2);
|
|
|
|
expect(getters.getCurrentPageFilter(state)('all')).toEqual(3);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('getHasEndReached', () => {
|
2020-02-26 15:45:01 +00:00
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|