@servicetitan/titan-chatbot-ui 3.1.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/components/chatbot/__tests-cy__/chatbot-help-center.test.js +2 -156
- package/dist/components/chatbot/__tests-cy__/chatbot-help-center.test.js.map +1 -1
- package/dist/components/chatbot/__tests-cy__/chatbot-live.test.js +2 -94
- package/dist/components/chatbot/__tests-cy__/chatbot-live.test.js.map +1 -1
- package/dist/components/chatbot/__tests-cy__/chatbot-titan-chatbot.test.js +2 -151
- package/dist/components/chatbot/__tests-cy__/chatbot-titan-chatbot.test.js.map +1 -1
- package/dist/components/chatbot/__tests-cy__/chatbot.test.js +2 -151
- package/dist/components/chatbot/__tests-cy__/chatbot.test.js.map +1 -1
- package/dist/components/chatbot/chatbot.d.ts +2 -1
- package/dist/components/chatbot/chatbot.d.ts.map +1 -1
- package/dist/components/chatbot/chatbot.js +2 -2
- package/dist/components/chatbot/chatbot.js.map +1 -1
- package/dist/components/chatbot/dialog/__tests-cy__/chatbot-restart-dialog.test.d.ts +2 -0
- package/dist/components/chatbot/dialog/__tests-cy__/chatbot-restart-dialog.test.d.ts.map +1 -0
- package/dist/components/chatbot/dialog/__tests-cy__/chatbot-restart-dialog.test.js +6 -0
- package/dist/components/chatbot/dialog/__tests-cy__/chatbot-restart-dialog.test.js.map +1 -0
- package/dist/components/chatbot/dialog/__tests-cy__/chatbot-restart-link.test.d.ts +2 -0
- package/dist/components/chatbot/dialog/__tests-cy__/chatbot-restart-link.test.d.ts.map +1 -0
- package/dist/components/chatbot/dialog/__tests-cy__/chatbot-restart-link.test.js +6 -0
- package/dist/components/chatbot/dialog/__tests-cy__/chatbot-restart-link.test.js.map +1 -0
- package/dist/components/chatbot/dialog/chatbot-restart-dialog.d.ts.map +1 -1
- package/dist/components/chatbot/dialog/chatbot-restart-dialog.js +1 -1
- package/dist/components/chatbot/dialog/chatbot-restart-dialog.js.map +1 -1
- package/dist/components/chatbot/feedback/__tests-cy__/chatbot-message-feedback-form-guardrail.test.js +2 -61
- package/dist/components/chatbot/feedback/__tests-cy__/chatbot-message-feedback-form-guardrail.test.js.map +1 -1
- package/dist/components/chatbot/feedback/__tests-cy__/chatbot-message-feedback-form.test.js +2 -96
- package/dist/components/chatbot/feedback/__tests-cy__/chatbot-message-feedback-form.test.js.map +1 -1
- package/dist/components/chatbot/feedback/__tests-cy__/chatbot-message-feedback-popover.test.d.ts +2 -0
- package/dist/components/chatbot/feedback/__tests-cy__/chatbot-message-feedback-popover.test.d.ts.map +1 -0
- package/dist/components/chatbot/feedback/__tests-cy__/chatbot-message-feedback-popover.test.js +6 -0
- package/dist/components/chatbot/feedback/__tests-cy__/chatbot-message-feedback-popover.test.js.map +1 -0
- package/dist/components/chatbot/feedback/__tests-cy__/chatbot-session-feedback-modal.test.d.ts +2 -0
- package/dist/components/chatbot/feedback/__tests-cy__/chatbot-session-feedback-modal.test.d.ts.map +1 -0
- package/dist/components/chatbot/feedback/__tests-cy__/chatbot-session-feedback-modal.test.js +6 -0
- package/dist/components/chatbot/feedback/__tests-cy__/chatbot-session-feedback-modal.test.js.map +1 -0
- package/dist/components/chatbot/feedback/chatbot-message-feedback-form-guardrail.d.ts.map +1 -1
- package/dist/components/chatbot/feedback/chatbot-message-feedback-form-guardrail.js +1 -1
- package/dist/components/chatbot/feedback/chatbot-message-feedback-form-guardrail.js.map +1 -1
- package/dist/components/chatbot/feedback/chatbot-message-feedback-form.d.ts.map +1 -1
- package/dist/components/chatbot/feedback/chatbot-message-feedback-form.js +1 -1
- package/dist/components/chatbot/feedback/chatbot-message-feedback-form.js.map +1 -1
- package/dist/components/chatbot/feedback/chatbot-message-feedback-popover.d.ts.map +1 -1
- package/dist/components/chatbot/feedback/chatbot-message-feedback-popover.js +2 -4
- package/dist/components/chatbot/feedback/chatbot-message-feedback-popover.js.map +1 -1
- package/dist/components/chatbot/feedback/chatbot-session-feedback-modal.d.ts.map +1 -1
- package/dist/components/chatbot/feedback/chatbot-session-feedback-modal.js +1 -2
- package/dist/components/chatbot/feedback/chatbot-session-feedback-modal.js.map +1 -1
- package/dist/components/chatbot/filters/__tests-cy__/chatbot-filters.test.d.ts +2 -0
- package/dist/components/chatbot/filters/__tests-cy__/chatbot-filters.test.d.ts.map +1 -0
- package/dist/components/chatbot/filters/__tests-cy__/chatbot-filters.test.js +6 -0
- package/dist/components/chatbot/filters/__tests-cy__/chatbot-filters.test.js.map +1 -0
- package/dist/components/chatbot/filters/chatbot-filter.js +1 -1
- package/dist/components/chatbot/filters/chatbot-filter.js.map +1 -1
- package/dist/components/chatbot/messages/__tests-cy__/chatbot-links.test.d.ts +2 -0
- package/dist/components/chatbot/messages/__tests-cy__/chatbot-links.test.d.ts.map +1 -0
- package/dist/components/chatbot/messages/__tests-cy__/chatbot-links.test.js +6 -0
- package/dist/components/chatbot/messages/__tests-cy__/chatbot-links.test.js.map +1 -0
- package/dist/components/chatbot/messages/__tests-cy__/chatbot-message-answer-readonly.test.d.ts +2 -0
- package/dist/components/chatbot/messages/__tests-cy__/chatbot-message-answer-readonly.test.d.ts.map +1 -0
- package/dist/components/chatbot/messages/__tests-cy__/chatbot-message-answer-readonly.test.js +6 -0
- package/dist/components/chatbot/messages/__tests-cy__/chatbot-message-answer-readonly.test.js.map +1 -0
- package/dist/components/chatbot/messages/__tests-cy__/chatbot-message-answer.test.js +3 -82
- package/dist/components/chatbot/messages/__tests-cy__/chatbot-message-answer.test.js.map +1 -1
- package/dist/components/chatbot/messages/__tests-cy__/chatbot-message-typing.test.js +3 -54
- package/dist/components/chatbot/messages/__tests-cy__/chatbot-message-typing.test.js.map +1 -1
- package/package.json +6 -6
- package/src/components/chatbot/__tests-cy__/chatbot-help-center.test.tsx +2 -206
- package/src/components/chatbot/__tests-cy__/chatbot-live.test.tsx +2 -128
- package/src/components/chatbot/__tests-cy__/chatbot-titan-chatbot.test.tsx +2 -202
- package/src/components/chatbot/__tests-cy__/chatbot.test.tsx +2 -197
- package/src/components/chatbot/chatbot.tsx +66 -63
- package/src/components/chatbot/dialog/__tests-cy__/chatbot-restart-dialog.test.tsx +6 -0
- package/src/components/chatbot/dialog/__tests-cy__/chatbot-restart-link.test.tsx +6 -0
- package/src/components/chatbot/dialog/chatbot-restart-dialog.tsx +1 -0
- package/src/components/chatbot/feedback/__tests-cy__/chatbot-message-feedback-form-guardrail.test.tsx +2 -85
- package/src/components/chatbot/feedback/__tests-cy__/chatbot-message-feedback-form.test.tsx +2 -127
- package/src/components/chatbot/feedback/__tests-cy__/chatbot-message-feedback-popover.test.tsx +6 -0
- package/src/components/chatbot/feedback/__tests-cy__/chatbot-session-feedback-modal.test.tsx +6 -0
- package/src/components/chatbot/feedback/chatbot-message-feedback-form-guardrail.tsx +1 -1
- package/src/components/chatbot/feedback/chatbot-message-feedback-form.tsx +1 -1
- package/src/components/chatbot/feedback/chatbot-message-feedback-popover.tsx +8 -5
- package/src/components/chatbot/feedback/chatbot-session-feedback-modal.tsx +1 -2
- package/src/components/chatbot/filters/__tests-cy__/chatbot-filters.test.tsx +6 -0
- package/src/components/chatbot/filters/chatbot-filter.tsx +1 -1
- package/src/components/chatbot/messages/__tests-cy__/chatbot-links.test.tsx +6 -0
- package/src/components/chatbot/messages/__tests-cy__/chatbot-message-answer-readonly.test.tsx +6 -0
- package/src/components/chatbot/messages/__tests-cy__/chatbot-message-answer.test.tsx +3 -107
- package/src/components/chatbot/messages/__tests-cy__/chatbot-message-typing.test.tsx +3 -68
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/stores/__tests__/message-feedback-guardrail.store.test.d.ts +0 -2
- package/dist/stores/__tests__/message-feedback-guardrail.store.test.d.ts.map +0 -1
- package/dist/stores/__tests__/message-feedback-guardrail.store.test.js +0 -49
- package/dist/stores/__tests__/message-feedback-guardrail.store.test.js.map +0 -1
- package/dist/stores/__tests__/message-feedback.store.test.d.ts +0 -2
- package/dist/stores/__tests__/message-feedback.store.test.d.ts.map +0 -1
- package/dist/stores/__tests__/message-feedback.store.test.js +0 -114
- package/dist/stores/__tests__/message-feedback.store.test.js.map +0 -1
- package/dist/stores/__tests__/session-feedback.store.test.d.ts +0 -2
- package/dist/stores/__tests__/session-feedback.store.test.d.ts.map +0 -1
- package/dist/stores/__tests__/session-feedback.store.test.js +0 -39
- package/dist/stores/__tests__/session-feedback.store.test.js.map +0 -1
- package/dist/stores/message-feedback-base.store.d.ts +0 -8
- package/dist/stores/message-feedback-base.store.d.ts.map +0 -1
- package/dist/stores/message-feedback-base.store.js +0 -2
- package/dist/stores/message-feedback-base.store.js.map +0 -1
- package/dist/stores/message-feedback-guardrail.store.d.ts +0 -16
- package/dist/stores/message-feedback-guardrail.store.d.ts.map +0 -1
- package/dist/stores/message-feedback-guardrail.store.js +0 -85
- package/dist/stores/message-feedback-guardrail.store.js.map +0 -1
- package/dist/stores/message-feedback.store.d.ts +0 -23
- package/dist/stores/message-feedback.store.d.ts.map +0 -1
- package/dist/stores/message-feedback.store.js +0 -145
- package/dist/stores/message-feedback.store.js.map +0 -1
- package/dist/stores/session-feedback.store.d.ts +0 -15
- package/dist/stores/session-feedback.store.d.ts.map +0 -1
- package/dist/stores/session-feedback.store.js +0 -75
- package/dist/stores/session-feedback.store.js.map +0 -1
- package/dist/utils/__tests__/axios-utils.test.d.ts +0 -2
- package/dist/utils/__tests__/axios-utils.test.d.ts.map +0 -1
- package/dist/utils/__tests__/axios-utils.test.js +0 -33
- package/dist/utils/__tests__/axios-utils.test.js.map +0 -1
- package/dist/utils/axios-utils.d.ts +0 -5
- package/dist/utils/axios-utils.d.ts.map +0 -1
- package/dist/utils/axios-utils.js +0 -23
- package/dist/utils/axios-utils.js.map +0 -1
- package/dist/utils/test-utils.d.ts +0 -5
- package/dist/utils/test-utils.d.ts.map +0 -1
- package/dist/utils/test-utils.js +0 -17
- package/dist/utils/test-utils.js.map +0 -1
- package/src/stores/__tests__/message-feedback-guardrail.store.test.ts +0 -61
- package/src/stores/__tests__/message-feedback.store.test.ts +0 -121
- package/src/stores/__tests__/session-feedback.store.test.ts +0 -47
- package/src/stores/message-feedback-base.store.ts +0 -8
- package/src/stores/message-feedback-guardrail.store.ts +0 -60
- package/src/stores/message-feedback.store.ts +0 -113
- package/src/stores/session-feedback.store.ts +0 -44
- package/src/utils/__tests__/axios-utils.test.ts +0 -40
- package/src/utils/axios-utils.ts +0 -25
- package/src/utils/test-utils.ts +0 -22
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { runChatbotLinksSharedTests } from '@servicetitan/titan-chatbot-ui-cypress';
|
|
2
|
+
import { ChatbotLinks } from '../chatbot-links';
|
|
3
|
+
describe('[ChatbotLinks]', () => {
|
|
4
|
+
runChatbotLinksSharedTests(ChatbotLinks);
|
|
5
|
+
});
|
|
6
|
+
//# sourceMappingURL=chatbot-links.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatbot-links.test.js","sourceRoot":"","sources":["../../../../../src/components/chatbot/messages/__tests-cy__/chatbot-links.test.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC5B,0BAA0B,CAAC,YAAY,CAAC,CAAC;AAC7C,CAAC,CAAC,CAAC"}
|
package/dist/components/chatbot/messages/__tests-cy__/chatbot-message-answer-readonly.test.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatbot-message-answer-readonly.test.d.ts","sourceRoot":"","sources":["../../../../../src/components/chatbot/messages/__tests-cy__/chatbot-message-answer-readonly.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { runChatbotMessageAnswerReadonlySharedTests } from '@servicetitan/titan-chatbot-ui-cypress';
|
|
2
|
+
import { ChatbotMessageAnswerReadonly } from '../chatbot-message-answer-readonly';
|
|
3
|
+
describe('[ChatbotMessageAnswerReadonly]', () => {
|
|
4
|
+
runChatbotMessageAnswerReadonlySharedTests(ChatbotMessageAnswerReadonly);
|
|
5
|
+
});
|
|
6
|
+
//# sourceMappingURL=chatbot-message-answer-readonly.test.js.map
|
package/dist/components/chatbot/messages/__tests-cy__/chatbot-message-answer-readonly.test.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatbot-message-answer-readonly.test.js","sourceRoot":"","sources":["../../../../../src/components/chatbot/messages/__tests-cy__/chatbot-message-answer-readonly.test.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,0CAA0C,EAAE,MAAM,wCAAwC,CAAC;AACpG,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAElF,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC5C,0CAA0C,CAAC,4BAA4B,CAAC,CAAC;AAC7E,CAAC,CAAC,CAAC"}
|
|
@@ -1,85 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Container, Provider } from '@servicetitan/react-ioc';
|
|
3
|
-
import { mockChatMessageModelText } from '@servicetitan/titan-chat-ui-common';
|
|
4
|
-
import { CHATBOT_UI_STORE_TOKEN, ChatbotUiStore, ModelsMocks, } from '@servicetitan/titan-chatbot-api';
|
|
5
|
-
import { ChatUiSelectors } from '@servicetitan/titan-chatbot-ui-cypress';
|
|
6
|
-
import { mount } from 'cypress/react';
|
|
1
|
+
import { runChatbotMessageAnswerSharedTests } from '@servicetitan/titan-chatbot-ui-cypress';
|
|
7
2
|
import { ChatbotMessageAnswer } from '../chatbot-message-answer';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
container.bind(CHATBOT_UI_STORE_TOKEN).to(ChatbotUiStore).inSingletonScope();
|
|
11
|
-
return container;
|
|
12
|
-
};
|
|
13
|
-
describe('<ChatbotMessageAnswer />', () => {
|
|
14
|
-
let container;
|
|
15
|
-
let uiStore;
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
container = initContainer();
|
|
18
|
-
uiStore = container.get(CHATBOT_UI_STORE_TOKEN);
|
|
19
|
-
cy.viewport(780, 800);
|
|
20
|
-
});
|
|
21
|
-
const renderComponent = (message) => {
|
|
22
|
-
const Wrapper = () => (_jsx(Provider, { singletons: [
|
|
23
|
-
{
|
|
24
|
-
provide: CHATBOT_UI_STORE_TOKEN,
|
|
25
|
-
useValue: uiStore,
|
|
26
|
-
},
|
|
27
|
-
], children: _jsx(ChatbotMessageAnswer, { message: message }) }));
|
|
28
|
-
mount(_jsx(Wrapper, {}));
|
|
29
|
-
};
|
|
30
|
-
it('should render MultilineText and ChatbotLinks when chatbotMessageData exists', () => {
|
|
31
|
-
cy.clock();
|
|
32
|
-
cy.spy(uiStore, 'triggerScroll').as('triggerScroll');
|
|
33
|
-
const botMessage = ModelsMocks.mockBotMessage({
|
|
34
|
-
scoredUrls: ModelsMocks.mockScoredUrls(),
|
|
35
|
-
});
|
|
36
|
-
const message = mockChatMessageModelText(true, {
|
|
37
|
-
message: 'Test message',
|
|
38
|
-
data: botMessage,
|
|
39
|
-
});
|
|
40
|
-
uiStore.setMessages([message]);
|
|
41
|
-
renderComponent(message);
|
|
42
|
-
ChatUiSelectors.chatbotMessageAnswer.should('contain.text', 'Test message');
|
|
43
|
-
ChatUiSelectors.chatbotLinksLink.should('not.be.visible');
|
|
44
|
-
// Expand links
|
|
45
|
-
ChatUiSelectors.chatbotLinksMore
|
|
46
|
-
.should('be.visible')
|
|
47
|
-
.should('have.text', 'Learn more')
|
|
48
|
-
.click();
|
|
49
|
-
cy.tick(100);
|
|
50
|
-
cy.get('@triggerScroll').should('be.called');
|
|
51
|
-
ChatUiSelectors.chatbotLinksLink.should('be.visible').should('have.length', 2);
|
|
52
|
-
// Collapse links
|
|
53
|
-
ChatUiSelectors.chatbotLinksMore
|
|
54
|
-
.should('be.visible')
|
|
55
|
-
.should('have.text', 'Learn less')
|
|
56
|
-
.click();
|
|
57
|
-
cy.tick(100);
|
|
58
|
-
cy.get('@triggerScroll').should('be.called');
|
|
59
|
-
ChatUiSelectors.chatbotLinksLink.should('not.be.visible');
|
|
60
|
-
});
|
|
61
|
-
it('should not render ChatbotLinks when no links exist', () => {
|
|
62
|
-
const botMessage = ModelsMocks.mockBotMessage({
|
|
63
|
-
scoredUrls: [],
|
|
64
|
-
});
|
|
65
|
-
const message = mockChatMessageModelText(true, {
|
|
66
|
-
message: 'Test message',
|
|
67
|
-
data: botMessage,
|
|
68
|
-
});
|
|
69
|
-
renderComponent(message);
|
|
70
|
-
ChatUiSelectors.chatbotMessageAnswer.should('contain.text', 'Test message');
|
|
71
|
-
ChatUiSelectors.chatbotLinksMore.should('not.exist');
|
|
72
|
-
ChatUiSelectors.chatbotLinksLink.should('not.exist');
|
|
73
|
-
});
|
|
74
|
-
it('should not render ChatbotLinks when chatbotMessageData is undefined', () => {
|
|
75
|
-
const message = mockChatMessageModelText(true, {
|
|
76
|
-
message: 'Test message',
|
|
77
|
-
data: undefined,
|
|
78
|
-
});
|
|
79
|
-
renderComponent(message);
|
|
80
|
-
ChatUiSelectors.chatbotMessageAnswer.should('contain.text', 'Test message');
|
|
81
|
-
ChatUiSelectors.chatbotLinksMore.should('not.exist');
|
|
82
|
-
ChatUiSelectors.chatbotLinksLink.should('not.exist');
|
|
83
|
-
});
|
|
3
|
+
describe('[ChatbotMessageAnswer]', () => {
|
|
4
|
+
runChatbotMessageAnswerSharedTests(ChatbotMessageAnswer);
|
|
84
5
|
});
|
|
85
6
|
//# sourceMappingURL=chatbot-message-answer.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot-message-answer.test.js","sourceRoot":"","sources":["../../../../../src/components/chatbot/messages/__tests-cy__/chatbot-message-answer.test.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chatbot-message-answer.test.js","sourceRoot":"","sources":["../../../../../src/components/chatbot/messages/__tests-cy__/chatbot-message-answer.test.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,wCAAwC,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACpC,kCAAkC,CAAC,oBAAoB,CAAC,CAAC;AAC7D,CAAC,CAAC,CAAC"}
|
|
@@ -1,57 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChatParticipantIcon } from '@servicetitan/titan-chat-ui-common';
|
|
3
|
-
import { ChatUiSelectors } from '@servicetitan/titan-chatbot-ui-cypress';
|
|
4
|
-
import { mount } from 'cypress/react';
|
|
1
|
+
import { runChatbotMessageTypingSharedTests } from '@servicetitan/titan-chatbot-ui-cypress';
|
|
5
2
|
import { ChatbotMessageTyping } from '../chatbot-message-typing';
|
|
6
|
-
describe('ChatbotMessageTyping', () => {
|
|
7
|
-
|
|
8
|
-
const avatar = {
|
|
9
|
-
name: 'Test User Name',
|
|
10
|
-
icon,
|
|
11
|
-
};
|
|
12
|
-
mount(_jsx(ChatbotMessageTyping, { avatar: avatar }));
|
|
13
|
-
ChatUiSelectors.chatMessageTyping.should('be.visible');
|
|
14
|
-
ChatUiSelectors.chatMessageTypingDots.should('be.visible');
|
|
15
|
-
}
|
|
16
|
-
it('should render message with bot icon', () => {
|
|
17
|
-
render(ChatParticipantIcon.Bot);
|
|
18
|
-
ChatUiSelectors.chatAvatarBot
|
|
19
|
-
.should('be.visible')
|
|
20
|
-
.invoke('css', 'background-image')
|
|
21
|
-
.then(bgColor => {
|
|
22
|
-
const isSvg = Boolean(bgColor.indexOf('data:image/svg+xml;base64') >= 0);
|
|
23
|
-
expect(isSvg).to.eq(true);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
it('should render message with empty icon', () => {
|
|
27
|
-
render(ChatParticipantIcon.Empty);
|
|
28
|
-
ChatUiSelectors.chatAvatarBot.should('not.exist');
|
|
29
|
-
ChatUiSelectors.chatAvatarInitials.should('not.exist');
|
|
30
|
-
});
|
|
31
|
-
it('should render message with initials', () => {
|
|
32
|
-
render(ChatParticipantIcon.Initials);
|
|
33
|
-
ChatUiSelectors.chatAvatarInitials.should('be.visible').should('contain.text', 'TU');
|
|
34
|
-
});
|
|
35
|
-
it('should show different messages during the time', () => {
|
|
36
|
-
cy.clock();
|
|
37
|
-
render(ChatParticipantIcon.Bot);
|
|
38
|
-
// Verify the rendered component + check the dots animation doesn't change over the time
|
|
39
|
-
ChatUiSelectors.chatMessageTypingDots.should('be.visible');
|
|
40
|
-
cy.tick(11000);
|
|
41
|
-
ChatUiSelectors.chatMessageContentAgent
|
|
42
|
-
.should('be.visible')
|
|
43
|
-
.should('contain.text', 'Looking for the final details');
|
|
44
|
-
ChatUiSelectors.chatMessageTypingDots.should('not.exist');
|
|
45
|
-
cy.tick(10000);
|
|
46
|
-
ChatUiSelectors.chatMessageContentAgent
|
|
47
|
-
.should('be.visible')
|
|
48
|
-
.should('contain.text', 'This is taking longer than usual, please give me a little bit more time');
|
|
49
|
-
ChatUiSelectors.chatMessageTypingDots.should('not.exist');
|
|
50
|
-
cy.tick(60000);
|
|
51
|
-
ChatUiSelectors.chatMessageContentAgent
|
|
52
|
-
.should('be.visible')
|
|
53
|
-
.should('contain.text', 'This is taking longer than usual, please give me a little bit more time');
|
|
54
|
-
ChatUiSelectors.chatMessageTypingDots.should('not.exist');
|
|
55
|
-
});
|
|
3
|
+
describe('[ChatbotMessageTyping]', () => {
|
|
4
|
+
runChatbotMessageTypingSharedTests(ChatbotMessageTyping);
|
|
56
5
|
});
|
|
57
6
|
//# sourceMappingURL=chatbot-message-typing.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot-message-typing.test.js","sourceRoot":"","sources":["../../../../../src/components/chatbot/messages/__tests-cy__/chatbot-message-typing.test.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chatbot-message-typing.test.js","sourceRoot":"","sources":["../../../../../src/components/chatbot/messages/__tests-cy__/chatbot-message-typing.test.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,wCAAwC,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACpC,kCAAkC,CAAC,oBAAoB,CAAC,CAAC;AAC7D,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/titan-chatbot-ui",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "Chatbot experience UI package",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"push:local": "yalc push"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@servicetitan/titan-chat-ui": "^3.1.
|
|
21
|
-
"@servicetitan/titan-chat-ui-common": "^3.1.
|
|
22
|
-
"@servicetitan/titan-chatbot-api": "^3.1.
|
|
20
|
+
"@servicetitan/titan-chat-ui": "^3.1.1",
|
|
21
|
+
"@servicetitan/titan-chat-ui-common": "^3.1.1",
|
|
22
|
+
"@servicetitan/titan-chatbot-api": "^3.1.1",
|
|
23
23
|
"nanoid": "^5.1.5"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"react-dom": "^18"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@servicetitan/titan-chatbot-ui-cypress": "^3.1.
|
|
45
|
+
"@servicetitan/titan-chatbot-ui-cypress": "^3.1.1",
|
|
46
46
|
"cypress": "^14.3.2"
|
|
47
47
|
},
|
|
48
48
|
"keywords": [
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"cli": {
|
|
56
56
|
"webpack": false
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "83c89de5b42d24ce5d7fcd034810bf596a673a08"
|
|
59
59
|
}
|
|
@@ -1,210 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Container, Provider } from '@servicetitan/react-ioc';
|
|
3
|
-
import {
|
|
4
|
-
ApiClientHelpCenter,
|
|
5
|
-
CHATBOT_API_CLIENT,
|
|
6
|
-
CHATBOT_CLIENT_SETTINGS,
|
|
7
|
-
CHATBOT_UI_BACKEND_STORE_TOKEN,
|
|
8
|
-
CHATBOT_UI_STORE_TOKEN,
|
|
9
|
-
ChatbotCustomizations,
|
|
10
|
-
ChatbotUiBackendStore,
|
|
11
|
-
ChatbotUiStore,
|
|
12
|
-
IChatbotApiClient,
|
|
13
|
-
IChatbotUiBackendStore,
|
|
14
|
-
IChatbotUiStore,
|
|
15
|
-
Models,
|
|
16
|
-
} from '@servicetitan/titan-chatbot-api';
|
|
17
|
-
import { ChatUiSelectors, CypressMocks } from '@servicetitan/titan-chatbot-ui-cypress';
|
|
18
|
-
import axios from 'axios';
|
|
19
|
-
import { mount } from 'cypress/react';
|
|
20
|
-
import { FC, useMemo } from 'react';
|
|
1
|
+
import { runChatbotHelpCenterSharedTests } from '@servicetitan/titan-chatbot-ui-cypress';
|
|
21
2
|
import { Chatbot } from '../chatbot';
|
|
22
3
|
|
|
23
|
-
const ChatbotBaseUrl = 'https://chatbot-api.example.com/base/url';
|
|
24
|
-
|
|
25
|
-
const initContainer = () => {
|
|
26
|
-
const rootContainer = new Container();
|
|
27
|
-
const container = new Container();
|
|
28
|
-
container.parent = rootContainer;
|
|
29
|
-
container.bind<ILog>(Log).to(CypressMocks.LogMock).inSingletonScope();
|
|
30
|
-
container.bind<IChatbotUiStore>(CHATBOT_UI_STORE_TOKEN).to(ChatbotUiStore).inSingletonScope();
|
|
31
|
-
container
|
|
32
|
-
.bind<IChatbotUiBackendStore>(CHATBOT_UI_BACKEND_STORE_TOKEN)
|
|
33
|
-
.to(ChatbotUiBackendStore)
|
|
34
|
-
.inSingletonScope();
|
|
35
|
-
|
|
36
|
-
// Set up Helpcenter API client
|
|
37
|
-
const clientSettings: ApiClientHelpCenter.IChatbotClientSettingsHelpCenter = {
|
|
38
|
-
area: 'FloatingChat',
|
|
39
|
-
instance: 'STapp',
|
|
40
|
-
constructorParametersFactory: () => ({
|
|
41
|
-
baseUrl: ChatbotBaseUrl,
|
|
42
|
-
axiosInstance: axios.create(),
|
|
43
|
-
}),
|
|
44
|
-
};
|
|
45
|
-
container
|
|
46
|
-
.bind<ApiClientHelpCenter.IChatbotClientSettingsHelpCenter>(CHATBOT_CLIENT_SETTINGS)
|
|
47
|
-
.toConstantValue(clientSettings);
|
|
48
|
-
container
|
|
49
|
-
.bind<IChatbotApiClient>(CHATBOT_API_CLIENT)
|
|
50
|
-
.to(ApiClientHelpCenter.ChatbotApiClient)
|
|
51
|
-
.inSingletonScope();
|
|
52
|
-
return container;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
4
|
describe('[Chatbot with Help Center API]', () => {
|
|
56
|
-
|
|
57
|
-
let log: CypressMocks.LogMock;
|
|
58
|
-
let apiClientSettings: ApiClientHelpCenter.IChatbotClientSettingsHelpCenter;
|
|
59
|
-
let apiClient: ApiClientHelpCenter.ChatbotApiClient;
|
|
60
|
-
let uiStore: ChatbotUiStore;
|
|
61
|
-
let uiBackendStore: ChatbotUiBackendStore;
|
|
62
|
-
|
|
63
|
-
beforeEach(() => {
|
|
64
|
-
container = initContainer();
|
|
65
|
-
log = container.get<CypressMocks.LogMock>(Log);
|
|
66
|
-
apiClientSettings =
|
|
67
|
-
container.get<ApiClientHelpCenter.IChatbotClientSettingsHelpCenter>(
|
|
68
|
-
CHATBOT_CLIENT_SETTINGS
|
|
69
|
-
);
|
|
70
|
-
apiClient = container.get<ApiClientHelpCenter.ChatbotApiClient>(CHATBOT_API_CLIENT);
|
|
71
|
-
uiStore = container.get<ChatbotUiStore>(CHATBOT_UI_STORE_TOKEN);
|
|
72
|
-
uiBackendStore = container.get<ChatbotUiBackendStore>(CHATBOT_UI_BACKEND_STORE_TOKEN);
|
|
73
|
-
cy.viewport(550, 800);
|
|
74
|
-
cy.clock(Date.parse('2023-10-01T00:00:00Z'));
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
const render = () => {
|
|
78
|
-
const ChatbotWrapper: FC = () => {
|
|
79
|
-
const customizationContext = useMemo<ChatbotCustomizations>(
|
|
80
|
-
() => ({
|
|
81
|
-
filters: { enabled: true },
|
|
82
|
-
feedback: { title: 'TITLE' },
|
|
83
|
-
}),
|
|
84
|
-
[]
|
|
85
|
-
);
|
|
86
|
-
return (
|
|
87
|
-
<Provider
|
|
88
|
-
singletons={[
|
|
89
|
-
{
|
|
90
|
-
provide: Log,
|
|
91
|
-
useValue: log,
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
provide: CHATBOT_CLIENT_SETTINGS,
|
|
95
|
-
useValue: apiClientSettings,
|
|
96
|
-
},
|
|
97
|
-
{ provide: CHATBOT_API_CLIENT, useValue: apiClient },
|
|
98
|
-
{
|
|
99
|
-
provide: CHATBOT_UI_STORE_TOKEN,
|
|
100
|
-
useValue: uiStore,
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
provide: CHATBOT_UI_BACKEND_STORE_TOKEN,
|
|
104
|
-
useValue: uiBackendStore,
|
|
105
|
-
},
|
|
106
|
-
]}
|
|
107
|
-
>
|
|
108
|
-
<Chatbot
|
|
109
|
-
className="h-100vh max-h-100vh of-x-hidden"
|
|
110
|
-
customizations={customizationContext}
|
|
111
|
-
/>
|
|
112
|
-
</Provider>
|
|
113
|
-
);
|
|
114
|
-
};
|
|
115
|
-
cy.spy(uiStore, 'run').as('runSpy');
|
|
116
|
-
mount(<ChatbotWrapper />);
|
|
117
|
-
return cy.wrap(
|
|
118
|
-
new Promise(resolve => {
|
|
119
|
-
cy.get('@runSpy')
|
|
120
|
-
.should('have.been.calledOnce')
|
|
121
|
-
.then((invocation: any) => {
|
|
122
|
-
const initPromise = invocation.firstCall.returnValue as ReturnType<
|
|
123
|
-
IChatbotUiStore['run']
|
|
124
|
-
>;
|
|
125
|
-
initPromise.then(resolve);
|
|
126
|
-
});
|
|
127
|
-
})
|
|
128
|
-
);
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
it('should render the chatbot with help center API', () => {
|
|
132
|
-
const sessionMock = CypressMocks.HC.CreateSession;
|
|
133
|
-
const messageMock = CypressMocks.HC.SendUserMessage;
|
|
134
|
-
const messageFeedbackMock = CypressMocks.HC.MessageFeedback;
|
|
135
|
-
const sessionFeedbackMock = CypressMocks.HC.SessionFeedback;
|
|
136
|
-
|
|
137
|
-
const aliasFilterOptions = CypressMocks.HC.interceptFilterOptions(ChatbotBaseUrl);
|
|
138
|
-
const aliasCreateSession = sessionMock.intercept(ChatbotBaseUrl);
|
|
139
|
-
const aliasSendUserMessage = messageMock.intercept(ChatbotBaseUrl);
|
|
140
|
-
const aliasMessageFeedback = messageFeedbackMock.intercept(ChatbotBaseUrl);
|
|
141
|
-
const aliasSessionFeedback = sessionFeedbackMock.intercept(ChatbotBaseUrl);
|
|
142
|
-
|
|
143
|
-
render().then(() => {
|
|
144
|
-
// Expect filters were loaded using the Help Center API
|
|
145
|
-
cy.wait(aliasFilterOptions).then(interception => {
|
|
146
|
-
// Check options were loaded correctly
|
|
147
|
-
expect(interception.request.url).to.equal(
|
|
148
|
-
`${ChatbotBaseUrl}/api/Chat/filter-options`
|
|
149
|
-
);
|
|
150
|
-
expect(interception.response?.body).to.an('object');
|
|
151
|
-
expect(interception.response?.body?.sources).to.an('array');
|
|
152
|
-
expect(interception.response?.body?.contentTypes).to.an('array');
|
|
153
|
-
expect(interception.response?.body?.productAreas).to.an('array');
|
|
154
|
-
expect(interception.response?.statusCode).to.equal(200);
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
// Ask the bot a question
|
|
158
|
-
cy.log('Sending message...');
|
|
159
|
-
ChatUiSelectors.chatInput.type(`${messageMock.request.text}{enter}`, { delay: 0 });
|
|
160
|
-
|
|
161
|
-
// Check that the session was created
|
|
162
|
-
cy.wait(aliasCreateSession).then(interception => {
|
|
163
|
-
expect(interception.request.url).to.equal(
|
|
164
|
-
`${ChatbotBaseUrl}/api/Chat/create-session`
|
|
165
|
-
);
|
|
166
|
-
expect(interception.request.body).to.deep.equal(sessionMock.request);
|
|
167
|
-
expect(interception.response?.body).to.deep.equal(sessionMock.response);
|
|
168
|
-
expect(interception.response?.statusCode).to.equal(200);
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
// Check the user message is sent
|
|
172
|
-
cy.wait(aliasSendUserMessage).then(interception => {
|
|
173
|
-
expect(interception.request.url).to.equal(
|
|
174
|
-
`${ChatbotBaseUrl}/api/Chat/user-message`
|
|
175
|
-
);
|
|
176
|
-
expect(interception.request.body).to.deep.equal(messageMock.request);
|
|
177
|
-
expect(interception.response?.body).to.deep.equal(messageMock.response);
|
|
178
|
-
expect(interception.response?.statusCode).to.equal(200);
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
// Send session feedback (manually)
|
|
182
|
-
cy.log('Sending session feedback...');
|
|
183
|
-
uiStore.sendSessionFeedback(
|
|
184
|
-
new Models.Feedback({
|
|
185
|
-
sessionId: sessionMock.response.id,
|
|
186
|
-
description: 'Good answer!',
|
|
187
|
-
rating: Models.FeedbackRatings.ThumbsUp,
|
|
188
|
-
})
|
|
189
|
-
);
|
|
190
|
-
cy.wait(aliasSessionFeedback).then(interception => {
|
|
191
|
-
expect(interception.request.url).to.equal(
|
|
192
|
-
`${ChatbotBaseUrl}/api/Chat/session-feedback?sessionId=${sessionMock.response.id}`
|
|
193
|
-
);
|
|
194
|
-
expect(interception.request.body).to.deep.equal(sessionFeedbackMock.request);
|
|
195
|
-
expect(interception.response?.statusCode).to.equal(200);
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
// Check the feedback is sent with thumbs up
|
|
199
|
-
cy.log('Sending message feedback...');
|
|
200
|
-
ChatUiSelectors.chatbotMessageFeedbackThumbsUp.scrollIntoView().click({ force: true });
|
|
201
|
-
cy.wait(aliasMessageFeedback).then(interception => {
|
|
202
|
-
expect(interception.request.url).to.equal(
|
|
203
|
-
`${ChatbotBaseUrl}/api/Chat/bot-message-feedback?sessionId=${messageMock.response.sessionId}&botMessageId=${messageMock.response.id}`
|
|
204
|
-
);
|
|
205
|
-
expect(interception.request.body).to.deep.equal(messageFeedbackMock.request);
|
|
206
|
-
expect(interception.response?.statusCode).to.equal(200);
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
});
|
|
5
|
+
runChatbotHelpCenterSharedTests(Chatbot);
|
|
210
6
|
});
|
|
@@ -1,135 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Container, Provider } from '@servicetitan/react-ioc';
|
|
3
|
-
import {
|
|
4
|
-
CHATBOT_API_CLIENT,
|
|
5
|
-
CHATBOT_UI_BACKEND_STORE_TOKEN,
|
|
6
|
-
CHATBOT_UI_STORE_TOKEN,
|
|
7
|
-
ChatbotCustomizations,
|
|
8
|
-
ChatbotUiBackendStore,
|
|
9
|
-
ChatbotUiStore,
|
|
10
|
-
IChatbotApiClient,
|
|
11
|
-
IChatbotUiBackendStore,
|
|
12
|
-
IChatbotUiStore,
|
|
13
|
-
Models,
|
|
14
|
-
ModelsMocks,
|
|
15
|
-
} from '@servicetitan/titan-chatbot-api';
|
|
16
|
-
import { ChatUiSelectors, CypressMocks } from '@servicetitan/titan-chatbot-ui-cypress';
|
|
17
|
-
import { mount } from 'cypress/react';
|
|
18
|
-
import { FC, useMemo } from 'react';
|
|
1
|
+
import { runChatbotLiveSharedTests } from '@servicetitan/titan-chatbot-ui-cypress';
|
|
19
2
|
import { Chatbot } from '../chatbot';
|
|
20
3
|
|
|
21
|
-
const initContainer = () => {
|
|
22
|
-
const rootContainer = new Container();
|
|
23
|
-
const container = new Container();
|
|
24
|
-
container.parent = rootContainer;
|
|
25
|
-
container.bind<ILog>(Log).to(CypressMocks.LogMock).inSingletonScope();
|
|
26
|
-
container
|
|
27
|
-
.bind<IChatbotApiClient>(CHATBOT_API_CLIENT)
|
|
28
|
-
.to(CypressMocks.ChatbotApiClientMock)
|
|
29
|
-
.inSingletonScope();
|
|
30
|
-
container.bind<IChatbotUiStore>(CHATBOT_UI_STORE_TOKEN).to(ChatbotUiStore).inSingletonScope();
|
|
31
|
-
container
|
|
32
|
-
.bind<IChatbotUiBackendStore>(CHATBOT_UI_BACKEND_STORE_TOKEN)
|
|
33
|
-
.to(ChatbotUiBackendStore)
|
|
34
|
-
.inSingletonScope();
|
|
35
|
-
return container;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
4
|
/**
|
|
39
5
|
* The test is for internal purposes only.
|
|
40
6
|
*/
|
|
41
7
|
describe('[Chatbot]', () => {
|
|
42
|
-
|
|
43
|
-
let log: CypressMocks.LogMock;
|
|
44
|
-
let api: CypressMocks.ChatbotApiClientMock;
|
|
45
|
-
let uiStore: ChatbotUiStore;
|
|
46
|
-
let uiBackendStore: ChatbotUiBackendStore;
|
|
47
|
-
|
|
48
|
-
const mockApi = () => {
|
|
49
|
-
api.postSession = cy.stub().resolves(ModelsMocks.mockSession());
|
|
50
|
-
api.getOptions = cy.stub().resolves(ModelsMocks.mockFrontendModel());
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
beforeEach(() => {
|
|
54
|
-
cy.intercept('GET', 'https://fonts.gstatic.com/**', {
|
|
55
|
-
statusCode: 200,
|
|
56
|
-
body: new ArrayBuffer(0),
|
|
57
|
-
headers: {
|
|
58
|
-
'Content-Type': 'font/woff2',
|
|
59
|
-
'Cache-Control': 'no-cache, no-store, must-revalidate',
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
container = initContainer();
|
|
63
|
-
log = container.get<CypressMocks.LogMock>(Log);
|
|
64
|
-
api = container.get<CypressMocks.ChatbotApiClientMock>(CHATBOT_API_CLIENT);
|
|
65
|
-
uiStore = container.get<ChatbotUiStore>(CHATBOT_UI_STORE_TOKEN);
|
|
66
|
-
uiBackendStore = container.get<ChatbotUiBackendStore>(CHATBOT_UI_BACKEND_STORE_TOKEN);
|
|
67
|
-
mockApi();
|
|
68
|
-
cy.viewport(550, 800);
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
const mockAskBotApi = (answer: string) => {
|
|
72
|
-
api.postMessage = cy.stub().as('askBot').resolves(
|
|
73
|
-
ModelsMocks.mockBotMessage({
|
|
74
|
-
answer,
|
|
75
|
-
})
|
|
76
|
-
);
|
|
77
|
-
api.postFeedback = cy
|
|
78
|
-
.stub()
|
|
79
|
-
.as('askBotFeedback')
|
|
80
|
-
.resolves(
|
|
81
|
-
ModelsMocks.mockFeedback({
|
|
82
|
-
rating: Models.FeedbackRatings.ThumbsUp,
|
|
83
|
-
})
|
|
84
|
-
);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const render = () => {
|
|
88
|
-
const ChatbotWrapper: FC = () => {
|
|
89
|
-
const customizationContext = useMemo<ChatbotCustomizations>(
|
|
90
|
-
() => ({
|
|
91
|
-
filters: { enabled: true },
|
|
92
|
-
feedback: { title: 'TITLE' },
|
|
93
|
-
}),
|
|
94
|
-
[]
|
|
95
|
-
);
|
|
96
|
-
return (
|
|
97
|
-
<Provider
|
|
98
|
-
singletons={[
|
|
99
|
-
{
|
|
100
|
-
provide: Log,
|
|
101
|
-
useValue: log,
|
|
102
|
-
},
|
|
103
|
-
{ provide: CHATBOT_API_CLIENT, useValue: api },
|
|
104
|
-
{
|
|
105
|
-
provide: CHATBOT_UI_STORE_TOKEN,
|
|
106
|
-
useValue: uiStore,
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
provide: CHATBOT_UI_BACKEND_STORE_TOKEN,
|
|
110
|
-
useValue: uiBackendStore,
|
|
111
|
-
},
|
|
112
|
-
]}
|
|
113
|
-
>
|
|
114
|
-
<Chatbot
|
|
115
|
-
className="h-100vh max-h-100vh of-x-hidden"
|
|
116
|
-
customizations={customizationContext}
|
|
117
|
-
/>
|
|
118
|
-
</Provider>
|
|
119
|
-
);
|
|
120
|
-
};
|
|
121
|
-
mount(<ChatbotWrapper />);
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
const ask = (message: string) => {
|
|
125
|
-
ChatUiSelectors.chatInput.type(`${message}{enter}`, { delay: 0 });
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
it.skip('should render the chatbot component', () => {
|
|
129
|
-
mockAskBotApi("Hello! I'm chatbot mocked response!!!");
|
|
130
|
-
render();
|
|
131
|
-
ask('Hello!');
|
|
132
|
-
ChatUiSelectors.chatbotMessageFeedbackThumbsUp.should('be.visible').click();
|
|
133
|
-
cy.get('@askBotFeedback').should('have.been.calledOnce');
|
|
134
|
-
});
|
|
8
|
+
runChatbotLiveSharedTests(Chatbot);
|
|
135
9
|
});
|