feat: Display "Snoozed Until" time on conversation header (#3028)

This commit is contained in:
Pranav Raj S
2021-09-29 19:33:51 +05:30
committed by GitHub
parent 49ac4a4400
commit 57abdc4d5f
19 changed files with 217 additions and 172 deletions

View File

@@ -217,15 +217,24 @@ describe('#actions', () => {
describe('#toggleStatus', () => {
it('sends correct mutations if toggle status is successful', async () => {
axios.post.mockResolvedValue({
data: { payload: { conversation_id: 1, current_status: 'resolved' } },
data: {
payload: {
conversation_id: 1,
current_status: 'snoozed',
snoozed_until: null,
},
},
});
await actions.toggleStatus(
{ commit },
{ conversationId: 1, status: 'resolved' }
{ conversationId: 1, status: 'snoozed' }
);
expect(commit).toHaveBeenCalledTimes(1);
expect(commit.mock.calls).toEqual([
['RESOLVE_CONVERSATION', { conversationId: 1, status: 'resolved' }],
[
'CHANGE_CONVERSATION_STATUS',
{ conversationId: 1, status: 'snoozed', snoozedUntil: null },
],
]);
});
});

View File

@@ -161,7 +161,7 @@ describe('#mutations', () => {
});
});
describe('#RESOLVE_CONVERSATION', () => {
describe('#CHANGE_CONVERSATION_STATUS', () => {
it('updates the conversation status correctly', () => {
const state = {
allConversations: [
@@ -173,7 +173,7 @@ describe('#mutations', () => {
],
};
mutations[types.RESOLVE_CONVERSATION](state, {
mutations[types.CHANGE_CONVERSATION_STATUS](state, {
conversationId: '1',
status: 'resolved',
});