mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 11:37:58 +00:00
feat: Ability to unmute muted conversations (#1319)
This commit is contained in:
committed by
GitHub
parent
2aad33a5be
commit
ecebe163e1
@@ -43,6 +43,10 @@ class ConversationApi extends ApiClient {
|
||||
return axios.post(`${this.url}/${conversationId}/mute`);
|
||||
}
|
||||
|
||||
unmute(conversationId) {
|
||||
return axios.post(`${this.url}/${conversationId}/unmute`);
|
||||
}
|
||||
|
||||
meta({ inboxId, status, assigneeType, labels }) {
|
||||
return axios.get(`${this.url}/meta`, {
|
||||
params: {
|
||||
|
||||
@@ -14,7 +14,32 @@ describe('#ConversationAPI', () => {
|
||||
expect(conversationAPI).toHaveProperty('markMessageRead');
|
||||
expect(conversationAPI).toHaveProperty('toggleTyping');
|
||||
expect(conversationAPI).toHaveProperty('mute');
|
||||
expect(conversationAPI).toHaveProperty('unmute');
|
||||
expect(conversationAPI).toHaveProperty('meta');
|
||||
expect(conversationAPI).toHaveProperty('sendEmailTranscript');
|
||||
});
|
||||
|
||||
describe('API calls', () => {
|
||||
let originalAxios = null;
|
||||
let axiosMock = null;
|
||||
|
||||
beforeEach(() => {
|
||||
originalAxios = window.axios;
|
||||
axiosMock = { post: jest.fn(() => Promise.resolve()) };
|
||||
|
||||
window.axios = axiosMock;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
window.axios = originalAxios;
|
||||
});
|
||||
|
||||
it('#unmute', () => {
|
||||
conversationAPI.unmute(45);
|
||||
|
||||
expect(axiosMock.post).toHaveBeenCalledWith(
|
||||
'/api/v1/conversations/45/unmute'
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user