Chatwoot/app/javascript/dashboard/store/modules/specs/conversationSearch/getters.spec.js
Pranav Raj S 7718cf7d2c
feat: Add global message search ()
* feat: Search messages by content

* Fix search UI

* Add specs

* chore: Filter search results

* Update highlight logic

* Rename query to searchTerm

Co-authored-by: Sojan <sojan@pepalo.com>
2020-11-08 01:46:45 +05:30

19 lines
510 B
JavaScript

import { getters } from '../../conversationSearch';
describe('#getters', () => {
it('getConversations', () => {
const state = {
records: [{ id: 1, messages: [{ id: 1, content: 'value' }] }],
};
expect(getters.getConversations(state)).toEqual([
{ id: 1, messages: [{ id: 1, content: 'value' }] },
]);
});
it('getUIFlags', () => {
const state = {
uiFlags: { isFetching: false },
};
expect(getters.getUIFlags(state)).toEqual({ isFetching: false });
});
});