fix: Resolve conversation with id instead of current conversation (#2731)

This commit is contained in:
Pranav Raj S
2021-08-02 13:11:07 +05:30
committed by GitHub
parent 9f3f238cb5
commit d88e3e3596
5 changed files with 54 additions and 8 deletions

View File

@@ -160,4 +160,31 @@ describe('#mutations', () => {
expect(global.bus.$emit).not.toHaveBeenCalled();
});
});
describe('#RESOLVE_CONVERSATION', () => {
it('updates the conversation status correctly', () => {
const state = {
allConversations: [
{
id: 1,
messages: [],
status: 'open',
},
],
};
mutations[types.RESOLVE_CONVERSATION](state, {
conversationId: '1',
status: 'resolved',
});
expect(state.allConversations).toEqual([
{
id: 1,
messages: [],
status: 'resolved',
},
]);
});
});
});