mirror of
https://github.com/lingble/chatwoot.git
synced 2025-12-01 02:23:48 +00:00
Feat: Show notes panel on crm page (#2320)
* Feat: Show notes panel on CRM page Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
committed by
GitHub
parent
75d05e55ae
commit
fe2af370e0
@@ -0,0 +1,37 @@
|
||||
import types from '../../../mutation-types';
|
||||
import { mutations } from '../../contactNotes';
|
||||
import allNotes from './fixtures';
|
||||
|
||||
describe('#mutations', () => {
|
||||
describe('#SET_CONTACT_NOTES', () => {
|
||||
it('set allNotes records', () => {
|
||||
const state = { records: {} };
|
||||
mutations[types.SET_CONTACT_NOTES](state, {
|
||||
data: allNotes,
|
||||
contactId: 1,
|
||||
});
|
||||
expect(state.records).toEqual({ 1: allNotes });
|
||||
});
|
||||
});
|
||||
|
||||
describe('#ADD_CONTACT_NOTE', () => {
|
||||
it('push newly created note to the store', () => {
|
||||
const state = { records: { 1: [allNotes[0]] } };
|
||||
mutations[types.ADD_CONTACT_NOTE](state, {
|
||||
data: allNotes[1],
|
||||
contactId: 1,
|
||||
});
|
||||
expect(state.records[1]).toEqual([allNotes[0], allNotes[1]]);
|
||||
});
|
||||
});
|
||||
describe('#DELETE_CONTACT_NOTE', () => {
|
||||
it('Delete existing note from records', () => {
|
||||
const state = { records: { 1: [{ id: 2 }] } };
|
||||
mutations[types.DELETE_CONTACT_NOTE](state, {
|
||||
noteId: 2,
|
||||
contactId: 1,
|
||||
});
|
||||
expect(state.records[1]).toEqual([]);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user