655c585358
* Add API to fetch conversations of a contact * Add conversation list in sidebar
23 lines
542 B
JavaScript
23 lines
542 B
JavaScript
import { getters } from '../../contactConversations';
|
|
|
|
describe('#getters', () => {
|
|
it('getContactConversation', () => {
|
|
const state = {
|
|
records: { 1: [{ id: 1, contact_id: 1, message: 'Hello' }] },
|
|
};
|
|
expect(getters.getContactConversation(state)(1)).toEqual([
|
|
{ id: 1, contact_id: 1, message: 'Hello' },
|
|
]);
|
|
});
|
|
|
|
it('getUIFlags', () => {
|
|
const state = {
|
|
uiFlags: {
|
|
isFetching: true,
|
|
},
|
|
};
|
|
expect(getters.getUIFlags(state)).toEqual({
|
|
isFetching: true,
|
|
});
|
|
});
|
|
});
|