chore: Improvements to utils to load article in widget (#7859)

This commit is contained in:
Nithin David Thomas
2023-09-05 21:37:51 +05:30
committed by GitHub
parent ce4cfee8bd
commit 9322112481
5 changed files with 41 additions and 3 deletions

View File

@@ -445,4 +445,33 @@ describe('#getters', () => {
};
expect(getters.getMessageCount(state)).toEqual(1);
});
it('getLastMessage', () => {
const state = {
conversations: {
1: {
id: 1,
content: 'Thanks for the help',
created_at: 1574075964,
message_type: 1,
},
2: {
id: 2,
content: 'Yes, It makes sense',
created_at: 1574092218,
message_type: 1,
},
3: {
id: 3,
content: 'Yes, It makes sense',
created_at: 1574092218,
message_type: 0,
},
},
meta: {
userLastSeenAt: 1674075964,
},
};
expect(getters.getLastMessage(state).id).toEqual(3);
});
});