[Enhancement] Group widget messages by users (#367)
* Remove thumbnail * Show grouped messages
This commit is contained in:
@@ -79,31 +79,41 @@ describe('#getters', () => {
|
||||
},
|
||||
},
|
||||
};
|
||||
expect(getters.getGroupedConversation(state)).toEqual({
|
||||
'Nov 18, 2019': [
|
||||
{
|
||||
id: 1,
|
||||
content: 'Thanks for the help',
|
||||
created_at: 1574075964,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
content: 'Yes, It makes sense',
|
||||
created_at: 1574092218,
|
||||
},
|
||||
],
|
||||
'Dec 14, 2019': [
|
||||
{
|
||||
id: 3,
|
||||
content: 'Hey',
|
||||
created_at: 1576340623,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
content: 'How may I help you',
|
||||
created_at: 1576340626,
|
||||
},
|
||||
],
|
||||
});
|
||||
expect(getters.getGroupedConversation(state)).toEqual([
|
||||
{
|
||||
date: 'Nov 18, 2019',
|
||||
messages: [
|
||||
{
|
||||
id: 1,
|
||||
content: 'Thanks for the help',
|
||||
created_at: 1574075964,
|
||||
showAvatar: false,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
content: 'Yes, It makes sense',
|
||||
created_at: 1574092218,
|
||||
showAvatar: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
date: 'Dec 14, 2019',
|
||||
messages: [
|
||||
{
|
||||
id: 3,
|
||||
content: 'Hey',
|
||||
created_at: 1576340623,
|
||||
showAvatar: false,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
content: 'How may I help you',
|
||||
created_at: 1576340626,
|
||||
showAvatar: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user