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
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { actions } from '../../conversationPage';
|
||||
import * as types from '../../../mutation-types';
|
||||
|
||||
const commit = jest.fn();
|
||||
|
||||
describe('#actions', () => {
|
||||
describe('#setCurrentPage', () => {
|
||||
it('sends correct actions', () => {
|
||||
actions.setCurrentPage({ commit }, { filter: 'me', page: 1 });
|
||||
expect(commit.mock.calls).toEqual([
|
||||
[types.default.SET_CURRENT_PAGE, { filter: 'me', page: 1 }],
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#setEndReached', () => {
|
||||
it('sends correct actions', () => {
|
||||
actions.setEndReached({ commit }, { filter: 'me' });
|
||||
expect(commit.mock.calls).toEqual([
|
||||
[types.default.SET_CONVERSATION_END_REACHED, { filter: 'me' }],
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#reset', () => {
|
||||
it('sends correct actions', () => {
|
||||
actions.reset({ commit });
|
||||
expect(commit.mock.calls).toEqual([
|
||||
[types.default.CLEAR_CONVERSATION_PAGE],
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user