Feature: Improve label experience (#975)
Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
@@ -74,4 +74,33 @@ describe('#actions', () => {
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#setBulkConversationLabels', () => {
|
||||
it('it send correct mutations', () => {
|
||||
actions.setBulkConversationLabels({ commit }, [
|
||||
{ id: 1, labels: ['customer-support'] },
|
||||
]);
|
||||
expect(commit.mock.calls).toEqual([
|
||||
[
|
||||
types.default.SET_BULK_CONVERSATION_LABELS,
|
||||
[{ id: 1, labels: ['customer-support'] }],
|
||||
],
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#setBulkConversationLabels', () => {
|
||||
it('it send correct mutations', () => {
|
||||
actions.setConversationLabel(
|
||||
{ commit },
|
||||
{ id: 1, data: ['customer-support'] }
|
||||
);
|
||||
expect(commit.mock.calls).toEqual([
|
||||
[
|
||||
types.default.SET_CONVERSATION_LABELS,
|
||||
{ id: 1, data: ['customer-support'] },
|
||||
],
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -15,7 +15,7 @@ describe('#mutations', () => {
|
||||
});
|
||||
|
||||
describe('#SET_CONVERSATION_LABELS', () => {
|
||||
it('set contact conversation records', () => {
|
||||
it('set contact labels', () => {
|
||||
const state = { records: {} };
|
||||
mutations[types.default.SET_CONVERSATION_LABELS](state, {
|
||||
id: 1,
|
||||
@@ -26,4 +26,24 @@ describe('#mutations', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('#SET_BULK_CONVERSATION_LABELS', () => {
|
||||
it('set contact labels in bulk', () => {
|
||||
const state = { records: {} };
|
||||
mutations[types.default.SET_BULK_CONVERSATION_LABELS](state, [
|
||||
{
|
||||
id: 1,
|
||||
labels: ['customer-success', 'on-hold'],
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
labels: ['customer-success'],
|
||||
},
|
||||
]);
|
||||
expect(state.records).toEqual({
|
||||
1: ['customer-success', 'on-hold'],
|
||||
2: ['customer-success'],
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user