Chore: Include Tamil, Arabic, other language updates (#1018)
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
This commit is contained in:
parent
0fc0dc1683
commit
a77cc713c2
418 changed files with 19359 additions and 328 deletions
|
@ -108,7 +108,6 @@ export const getters = {
|
|||
getIsFetchingList: _state => _state.uiFlags.isFetchingList,
|
||||
getUnreadMessageCount: _state => {
|
||||
const { userLastSeenAt } = _state.meta;
|
||||
console.log(userLastSeenAt);
|
||||
const count = Object.values(_state.conversations).filter(chat => {
|
||||
const { created_at: createdAt, message_type: messageType } = chat;
|
||||
const isOutGoing = messageType === MESSAGE_TYPE.OUTGOING;
|
||||
|
@ -122,7 +121,6 @@ export const getters = {
|
|||
getUnreadTextMessages: (_state, _getters) => {
|
||||
const unreadCount = _getters.getUnreadMessageCount;
|
||||
const allMessages = [...Object.values(_state.conversations)];
|
||||
console.log(unreadCount);
|
||||
const unreadAgentMessages = allMessages.filter(message => {
|
||||
const { message_type: messageType } = message;
|
||||
return messageType === MESSAGE_TYPE.OUTGOING;
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
import { playNotificationAudio } from 'shared/helpers/AudioNotificationHelper';
|
||||
import { actions } from '../../conversation';
|
||||
import getUuid from '../../../../helpers/uuid';
|
||||
import { API } from 'widget/helpers/axios';
|
||||
|
||||
jest.mock('../../../../helpers/uuid');
|
||||
jest.mock('shared/helpers/AudioNotificationHelper', () => ({
|
||||
playNotificationAudio: jest.fn(),
|
||||
}));
|
||||
jest.mock('widget/helpers/axios');
|
||||
|
||||
const commit = jest.fn();
|
||||
|
||||
|
@ -88,10 +90,21 @@ describe('#actions', () => {
|
|||
});
|
||||
|
||||
describe('#setUserLastSeen', () => {
|
||||
it('sends correct mutations', () => {
|
||||
const lastSeen = Math.abs(Date.now() / 1000);
|
||||
actions.setUserLastSeen({ commit }, { lastSeen });
|
||||
expect(commit).toBeCalledWith('setMetaUserLastSeenAt', lastSeen);
|
||||
it('sends correct mutations', async () => {
|
||||
API.post.mockResolvedValue({ data: { success: true } });
|
||||
await actions.setUserLastSeen({
|
||||
commit,
|
||||
getters: { getConversationSize: 2 },
|
||||
});
|
||||
expect(commit.mock.calls[0][0]).toEqual('setMetaUserLastSeenAt');
|
||||
});
|
||||
it('sends correct mutations', async () => {
|
||||
API.post.mockResolvedValue({ data: { success: true } });
|
||||
await actions.setUserLastSeen({
|
||||
commit,
|
||||
getters: { getConversationSize: 0 },
|
||||
});
|
||||
expect(commit.mock.calls).toEqual([]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue