Chore: Include Tamil, Arabic, other language updates (#1018)

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
This commit is contained in:
Sojan Jose 2020-07-08 00:59:30 +05:30 committed by GitHub
parent 0fc0dc1683
commit a77cc713c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
418 changed files with 19359 additions and 328 deletions

View file

@ -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;

View file

@ -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([]);
});
});
});