Feature: Typing Indicator on widget and dashboard (#811)
* Adds typing indicator for widget * typing indicator for agents in dashboard Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
This commit is contained in:
committed by
GitHub
parent
fabc3170b7
commit
5bc8219db5
@@ -33,6 +33,15 @@ describe('#actions', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('#toggleAgentTyping', () => {
|
||||
it('sends correct mutations', () => {
|
||||
actions.toggleAgentTyping({ commit }, { status: true });
|
||||
expect(commit).toBeCalledWith('toggleAgentTypingStatus', {
|
||||
status: true,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('#sendMessage', () => {
|
||||
it('sends correct mutations', () => {
|
||||
const mockDate = new Date(1466424490000);
|
||||
|
||||
@@ -48,10 +48,12 @@ describe('#getters', () => {
|
||||
uiFlags: {
|
||||
allMessagesLoaded: false,
|
||||
isFetchingList: false,
|
||||
isAgentTyping: false,
|
||||
},
|
||||
};
|
||||
expect(getters.getAllMessagesLoaded(state)).toEqual(false);
|
||||
expect(getters.getIsFetchingList(state)).toEqual(false);
|
||||
expect(getters.getIsAgentTyping(state)).toEqual(false);
|
||||
});
|
||||
|
||||
it('uiFlags', () => {
|
||||
|
||||
@@ -93,6 +93,20 @@ describe('#mutations', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('#toggleAgentTypingStatus', () => {
|
||||
it('sets isAgentTyping flag to true', () => {
|
||||
const state = { uiFlags: { isAgentTyping: false } };
|
||||
mutations.toggleAgentTypingStatus(state, { status: 'on' });
|
||||
expect(state.uiFlags.isAgentTyping).toEqual(true);
|
||||
});
|
||||
|
||||
it('sets isAgentTyping flag to false', () => {
|
||||
const state = { uiFlags: { isAgentTyping: false } };
|
||||
mutations.toggleAgentTypingStatus(state, { status: 'off' });
|
||||
expect(state.uiFlags.isAgentTyping).toEqual(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#updateAttachmentMessageStatus', () => {
|
||||
it('Updates status of loading messages if payload is not empty', () => {
|
||||
const state = {
|
||||
|
||||
Reference in New Issue
Block a user