Feature: View a contact's previous conversation (#422)

* Add API to fetch conversations of a contact

* Add conversation list in sidebar
This commit is contained in:
Pranav Raj S
2020-01-13 11:17:03 +05:30
committed by Sojan Jose
parent fc6a8c2601
commit 655c585358
19 changed files with 491 additions and 5 deletions

View File

@@ -0,0 +1,23 @@
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,
});
});
});