fix: reopen pending human conversations
Build and publish Docker images / Build and publish images (push) Successful in 2m23s

This commit is contained in:
2026-09-14 18:55:51 +08:00
parent 665e531dc3
commit 9b8d575657
7 changed files with 121 additions and 14 deletions
@@ -3,42 +3,61 @@ import { mutations } from '../../conversationAttributes';
describe('#mutations', () => {
describe('#SET_CONVERSATION_ATTRIBUTES', () => {
it('set status of the conversation', () => {
const state = { id: '', status: '' };
const state = { id: '', status: '', aiTakeoverActive: false };
mutations.SET_CONVERSATION_ATTRIBUTES(state, {
id: 1,
status: 'open',
ai_takeover_active: true,
});
expect(state).toEqual({
id: 1,
status: 'open',
aiTakeoverActive: true,
});
expect(state).toEqual({ id: 1, status: 'open' });
});
});
describe('#UPDATE_CONVERSATION_ATTRIBUTES', () => {
it('update status if it is same conversation', () => {
const state = { id: 1, status: 'pending' };
const state = { id: 1, status: 'pending', aiTakeoverActive: false };
mutations.UPDATE_CONVERSATION_ATTRIBUTES(state, {
id: 1,
status: 'open',
ai_takeover_active: true,
});
expect(state).toEqual({
id: 1,
status: 'open',
aiTakeoverActive: true,
});
expect(state).toEqual({ id: 1, status: 'open' });
});
it('doesnot update status if it is not the same conversation', () => {
const state = { id: 1, status: 'pending' };
const state = { id: 1, status: 'pending', aiTakeoverActive: false };
mutations.UPDATE_CONVERSATION_ATTRIBUTES(state, {
id: 2,
status: 'open',
ai_takeover_active: true,
});
expect(state).toEqual({
id: 1,
status: 'pending',
aiTakeoverActive: false,
});
expect(state).toEqual({ id: 1, status: 'pending' });
});
});
describe('#CLEAR_CONVERSATION_ATTRIBUTES', () => {
it('clear status if it is same conversation', () => {
const state = { id: 1, status: 'open' };
const state = { id: 1, status: 'open', aiTakeoverActive: true };
mutations.CLEAR_CONVERSATION_ATTRIBUTES(state, {
id: 1,
status: 'open',
});
expect(state).toEqual({ id: '', status: '' });
expect(state).toEqual({
id: '',
status: '',
aiTakeoverActive: false,
});
});
});
});