Feature: Support file type messages on widget and dashboard (#659)
- Adds support for file upload Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com> Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
parent
0afa5c297f
commit
7fcd2d0e85
28 changed files with 338 additions and 69 deletions
|
@ -49,7 +49,7 @@ describe('#actions', () => {
|
|||
getUuid.mockImplementationOnce(() => '1111');
|
||||
const spy = jest.spyOn(global, 'Date').mockImplementation(() => mockDate);
|
||||
const thumbUrl = '';
|
||||
const attachment = { thumbUrl };
|
||||
const attachment = { thumbUrl, fileType: 'file' };
|
||||
|
||||
actions.sendAttachment({ commit }, { attachment });
|
||||
spy.mockRestore();
|
||||
|
@ -62,7 +62,7 @@ describe('#actions', () => {
|
|||
attachment: {
|
||||
thumb_url: '',
|
||||
data_url: '',
|
||||
file_type: 'image',
|
||||
file_type: 'file',
|
||||
status: 'in_progress',
|
||||
},
|
||||
});
|
||||
|
|
|
@ -102,6 +102,10 @@ describe('#mutations', () => {
|
|||
id: 'rand_id_123',
|
||||
message_type: 0,
|
||||
status: 'in_progress',
|
||||
attachment: {
|
||||
file: '',
|
||||
file_type: 'image',
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -109,11 +113,24 @@ describe('#mutations', () => {
|
|||
id: '1',
|
||||
content: '',
|
||||
status: 'sent',
|
||||
attachment: {
|
||||
file: '',
|
||||
file_type: 'image',
|
||||
},
|
||||
};
|
||||
mutations.setMessageStatus(state, { message, tempId: 'rand_id_123' });
|
||||
|
||||
expect(state.conversations).toEqual({
|
||||
1: { id: '1', content: '', message_type: 0, status: 'sent' },
|
||||
1: {
|
||||
id: '1',
|
||||
content: '',
|
||||
message_type: 0,
|
||||
status: 'sent',
|
||||
attachment: {
|
||||
file: '',
|
||||
file_type: 'image',
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue