@servicetitan/titan-chatbot-ui-cypress 3.1.1 → 3.1.2
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/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/package.json +5 -12
- package/src/index.ts +0 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/tests/index.d.ts +0 -30
- package/dist/tests/index.d.ts.map +0 -1
- package/dist/tests/index.js +0 -30
- package/dist/tests/index.js.map +0 -1
- package/dist/tests/titan-chat-ui/chat-error.shared-tests.d.ts +0 -3
- package/dist/tests/titan-chat-ui/chat-error.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chat-ui/chat-error.shared-tests.js +0 -138
- package/dist/tests/titan-chat-ui/chat-error.shared-tests.js.map +0 -1
- package/dist/tests/titan-chat-ui/chat-input-file.shared-tests.d.ts +0 -7
- package/dist/tests/titan-chat-ui/chat-input-file.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chat-ui/chat-input-file.shared-tests.js +0 -123
- package/dist/tests/titan-chat-ui/chat-input-file.shared-tests.js.map +0 -1
- package/dist/tests/titan-chat-ui/chat-input.shared-tests.d.ts +0 -3
- package/dist/tests/titan-chat-ui/chat-input.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chat-ui/chat-input.shared-tests.js +0 -71
- package/dist/tests/titan-chat-ui/chat-input.shared-tests.js.map +0 -1
- package/dist/tests/titan-chat-ui/chat-log.shared-tests.d.ts +0 -9
- package/dist/tests/titan-chat-ui/chat-log.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chat-ui/chat-log.shared-tests.js +0 -73
- package/dist/tests/titan-chat-ui/chat-log.shared-tests.js.map +0 -1
- package/dist/tests/titan-chat-ui/chat-messages.shared-tests.d.ts +0 -8
- package/dist/tests/titan-chat-ui/chat-messages.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chat-ui/chat-messages.shared-tests.js +0 -118
- package/dist/tests/titan-chat-ui/chat-messages.shared-tests.js.map +0 -1
- package/dist/tests/titan-chat-ui/chat-notifications.shared-tests.d.ts +0 -3
- package/dist/tests/titan-chat-ui/chat-notifications.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chat-ui/chat-notifications.shared-tests.js +0 -110
- package/dist/tests/titan-chat-ui/chat-notifications.shared-tests.js.map +0 -1
- package/dist/tests/titan-chat-ui/chat-timer.shared-tests.d.ts +0 -3
- package/dist/tests/titan-chat-ui/chat-timer.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chat-ui/chat-timer.shared-tests.js +0 -76
- package/dist/tests/titan-chat-ui/chat-timer.shared-tests.js.map +0 -1
- package/dist/tests/titan-chat-ui/chat.shared-tests.d.ts +0 -9
- package/dist/tests/titan-chat-ui/chat.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chat-ui/chat.shared-tests.js +0 -111
- package/dist/tests/titan-chat-ui/chat.shared-tests.js.map +0 -1
- package/dist/tests/titan-chat-ui/message-agent.shared-tests.d.ts +0 -27
- package/dist/tests/titan-chat-ui/message-agent.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chat-ui/message-agent.shared-tests.js +0 -67
- package/dist/tests/titan-chat-ui/message-agent.shared-tests.js.map +0 -1
- package/dist/tests/titan-chat-ui/message-content-file.shared-tests.d.ts +0 -10
- package/dist/tests/titan-chat-ui/message-content-file.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chat-ui/message-content-file.shared-tests.js +0 -88
- package/dist/tests/titan-chat-ui/message-content-file.shared-tests.js.map +0 -1
- package/dist/tests/titan-chat-ui/message-system.shared-tests.d.ts +0 -16
- package/dist/tests/titan-chat-ui/message-system.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chat-ui/message-system.shared-tests.js +0 -65
- package/dist/tests/titan-chat-ui/message-system.shared-tests.js.map +0 -1
- package/dist/tests/titan-chat-ui/message-timeout.shared-tests.d.ts +0 -8
- package/dist/tests/titan-chat-ui/message-timeout.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chat-ui/message-timeout.shared-tests.js +0 -63
- package/dist/tests/titan-chat-ui/message-timeout.shared-tests.js.map +0 -1
- package/dist/tests/titan-chat-ui/message-typing.shared-tests.d.ts +0 -12
- package/dist/tests/titan-chat-ui/message-typing.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chat-ui/message-typing.shared-tests.js +0 -46
- package/dist/tests/titan-chat-ui/message-typing.shared-tests.js.map +0 -1
- package/dist/tests/titan-chat-ui/message-user.shared-tests.d.ts +0 -10
- package/dist/tests/titan-chat-ui/message-user.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chat-ui/message-user.shared-tests.js +0 -64
- package/dist/tests/titan-chat-ui/message-user.shared-tests.js.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-filters.shared-tests.d.ts +0 -7
- package/dist/tests/titan-chatbot-ui/chatbot-filters.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-filters.shared-tests.js +0 -118
- package/dist/tests/titan-chatbot-ui/chatbot-filters.shared-tests.js.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-help-center.shared-tests.d.ts +0 -9
- package/dist/tests/titan-chatbot-ui/chatbot-help-center.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-help-center.shared-tests.js +0 -162
- package/dist/tests/titan-chatbot-ui/chatbot-help-center.shared-tests.js.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-links.shared-tests.d.ts +0 -15
- package/dist/tests/titan-chatbot-ui/chatbot-links.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-links.shared-tests.js +0 -123
- package/dist/tests/titan-chatbot-ui/chatbot-links.shared-tests.js.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-live.shared-tests.d.ts +0 -9
- package/dist/tests/titan-chatbot-ui/chatbot-live.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-live.shared-tests.js +0 -84
- package/dist/tests/titan-chatbot-ui/chatbot-live.shared-tests.js.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-message-answer-readonly.shared-tests.d.ts +0 -8
- package/dist/tests/titan-chatbot-ui/chatbot-message-answer-readonly.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-message-answer-readonly.shared-tests.js +0 -142
- package/dist/tests/titan-chatbot-ui/chatbot-message-answer-readonly.shared-tests.js.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-message-answer.shared-tests.d.ts +0 -8
- package/dist/tests/titan-chatbot-ui/chatbot-message-answer.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-message-answer.shared-tests.js +0 -105
- package/dist/tests/titan-chatbot-ui/chatbot-message-answer.shared-tests.js.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-message-feedback-form-guardrail.shared-tests.d.ts +0 -3
- package/dist/tests/titan-chatbot-ui/chatbot-message-feedback-form-guardrail.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-message-feedback-form-guardrail.shared-tests.js +0 -86
- package/dist/tests/titan-chatbot-ui/chatbot-message-feedback-form-guardrail.shared-tests.js.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-message-feedback-form.shared-tests.d.ts +0 -3
- package/dist/tests/titan-chatbot-ui/chatbot-message-feedback-form.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-message-feedback-form.shared-tests.js +0 -143
- package/dist/tests/titan-chatbot-ui/chatbot-message-feedback-form.shared-tests.js.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-message-feedback-popover.shared-tests.d.ts +0 -8
- package/dist/tests/titan-chatbot-ui/chatbot-message-feedback-popover.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-message-feedback-popover.shared-tests.js +0 -200
- package/dist/tests/titan-chatbot-ui/chatbot-message-feedback-popover.shared-tests.js.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-message-typing.shared-tests.d.ts +0 -11
- package/dist/tests/titan-chatbot-ui/chatbot-message-typing.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-message-typing.shared-tests.js +0 -81
- package/dist/tests/titan-chatbot-ui/chatbot-message-typing.shared-tests.js.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-restart-dialog.shared-tests.d.ts +0 -8
- package/dist/tests/titan-chatbot-ui/chatbot-restart-dialog.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-restart-dialog.shared-tests.js +0 -60
- package/dist/tests/titan-chatbot-ui/chatbot-restart-dialog.shared-tests.js.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-restart-link.shared-tests.d.ts +0 -8
- package/dist/tests/titan-chatbot-ui/chatbot-restart-link.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-restart-link.shared-tests.js +0 -77
- package/dist/tests/titan-chatbot-ui/chatbot-restart-link.shared-tests.js.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-session-feedback-modal.shared-tests.d.ts +0 -7
- package/dist/tests/titan-chatbot-ui/chatbot-session-feedback-modal.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-session-feedback-modal.shared-tests.js +0 -130
- package/dist/tests/titan-chatbot-ui/chatbot-session-feedback-modal.shared-tests.js.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-titan-chatbot.shared-tests.d.ts +0 -9
- package/dist/tests/titan-chatbot-ui/chatbot-titan-chatbot.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot-titan-chatbot.shared-tests.js +0 -157
- package/dist/tests/titan-chatbot-ui/chatbot-titan-chatbot.shared-tests.js.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot.shared-tests.d.ts +0 -9
- package/dist/tests/titan-chatbot-ui/chatbot.shared-tests.d.ts.map +0 -1
- package/dist/tests/titan-chatbot-ui/chatbot.shared-tests.js +0 -114
- package/dist/tests/titan-chatbot-ui/chatbot.shared-tests.js.map +0 -1
- package/dist/utils/test-utils-chatbot.d.ts +0 -5
- package/dist/utils/test-utils-chatbot.d.ts.map +0 -1
- package/dist/utils/test-utils-chatbot.js +0 -55
- package/dist/utils/test-utils-chatbot.js.map +0 -1
- package/dist/utils/test-utils.d.ts +0 -6
- package/dist/utils/test-utils.d.ts.map +0 -1
- package/dist/utils/test-utils.js +0 -38
- package/dist/utils/test-utils.js.map +0 -1
- package/src/tests/index.ts +0 -30
- package/src/tests/titan-chat-ui/chat-error.shared-tests.tsx +0 -185
- package/src/tests/titan-chat-ui/chat-input-file.shared-tests.tsx +0 -182
- package/src/tests/titan-chat-ui/chat-input.shared-tests.tsx +0 -99
- package/src/tests/titan-chat-ui/chat-log.shared-tests.tsx +0 -117
- package/src/tests/titan-chat-ui/chat-messages.shared-tests.tsx +0 -156
- package/src/tests/titan-chat-ui/chat-notifications.shared-tests.tsx +0 -153
- package/src/tests/titan-chat-ui/chat-timer.shared-tests.tsx +0 -106
- package/src/tests/titan-chat-ui/chat.shared-tests.tsx +0 -158
- package/src/tests/titan-chat-ui/message-agent.shared-tests.tsx +0 -170
- package/src/tests/titan-chat-ui/message-content-file.shared-tests.tsx +0 -139
- package/src/tests/titan-chat-ui/message-system.shared-tests.tsx +0 -147
- package/src/tests/titan-chat-ui/message-timeout.shared-tests.tsx +0 -117
- package/src/tests/titan-chat-ui/message-typing.shared-tests.tsx +0 -92
- package/src/tests/titan-chat-ui/message-user.shared-tests.tsx +0 -138
- package/src/tests/titan-chatbot-ui/chatbot-filters.shared-tests.tsx +0 -164
- package/src/tests/titan-chatbot-ui/chatbot-help-center.shared-tests.tsx +0 -225
- package/src/tests/titan-chatbot-ui/chatbot-links.shared-tests.tsx +0 -189
- package/src/tests/titan-chatbot-ui/chatbot-live.shared-tests.tsx +0 -127
- package/src/tests/titan-chatbot-ui/chatbot-message-answer-readonly.shared-tests.tsx +0 -187
- package/src/tests/titan-chatbot-ui/chatbot-message-answer.shared-tests.tsx +0 -144
- package/src/tests/titan-chatbot-ui/chatbot-message-feedback-form-guardrail.shared-tests.tsx +0 -127
- package/src/tests/titan-chatbot-ui/chatbot-message-feedback-form.shared-tests.tsx +0 -198
- package/src/tests/titan-chatbot-ui/chatbot-message-feedback-popover.shared-tests.tsx +0 -285
- package/src/tests/titan-chatbot-ui/chatbot-message-typing.shared-tests.tsx +0 -112
- package/src/tests/titan-chatbot-ui/chatbot-restart-dialog.shared-tests.tsx +0 -91
- package/src/tests/titan-chatbot-ui/chatbot-restart-link.shared-tests.tsx +0 -116
- package/src/tests/titan-chatbot-ui/chatbot-session-feedback-modal.shared-tests.tsx +0 -182
- package/src/tests/titan-chatbot-ui/chatbot-titan-chatbot.shared-tests.tsx +0 -221
- package/src/tests/titan-chatbot-ui/chatbot.shared-tests.tsx +0 -158
- package/src/utils/test-utils-chatbot.tsx +0 -73
- package/src/utils/test-utils.tsx +0 -52
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot.shared-tests.d.ts","sourceRoot":"","sources":["../../../src/tests/titan-chatbot-ui/chatbot.shared-tests.tsx"],"names":[],"mappings":"AACA,OAAO,EAGH,qBAAqB,EAKxB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAIxD,UAAU,aAAa;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,cAAc,CAAC,EAAE,qBAAqB,CAAC;CAC1C;AAED,wBAAgB,qBAAqB,CACjC,gBAAgB,EAAE,EAAE,CAAC,aAAa,CAAC,EACnC,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,YAAY,QAwI/D"}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { CHATBOT_API_CLIENT, CHATBOT_UI_STORE_TOKEN, Models, ModelsMocks, } from '@servicetitan/titan-chatbot-api';
|
|
3
|
-
import { testInitContainerChatbot, testRenderWrapperChatbot } from '../..';
|
|
4
|
-
import { ChatUiSelectors } from '../../utils/chat-ui-selectors';
|
|
5
|
-
export function runChatbotSharedTests(ChatbotComponent, wrapperComponent) {
|
|
6
|
-
let container;
|
|
7
|
-
let api;
|
|
8
|
-
let chatbotUiStore;
|
|
9
|
-
const mockApiClient = () => {
|
|
10
|
-
api.postSession = cy.stub().resolves(ModelsMocks.mockSession());
|
|
11
|
-
api.getOptions = cy.stub().resolves(ModelsMocks.mockFrontendModel());
|
|
12
|
-
};
|
|
13
|
-
const mockAskBotApi = (answer) => {
|
|
14
|
-
api.postMessage = cy.stub().as('askBot').resolves(ModelsMocks.mockBotMessage({
|
|
15
|
-
answer,
|
|
16
|
-
}));
|
|
17
|
-
api.postFeedback = cy
|
|
18
|
-
.stub()
|
|
19
|
-
.as('askBotFeedback')
|
|
20
|
-
.resolves(ModelsMocks.mockFeedback({
|
|
21
|
-
rating: Models.FeedbackRatings.ThumbsUp,
|
|
22
|
-
}));
|
|
23
|
-
};
|
|
24
|
-
beforeEach(() => {
|
|
25
|
-
container = testInitContainerChatbot();
|
|
26
|
-
api = container.get(CHATBOT_API_CLIENT);
|
|
27
|
-
chatbotUiStore = container.get(CHATBOT_UI_STORE_TOKEN);
|
|
28
|
-
mockApiClient();
|
|
29
|
-
cy.viewport(550, 800);
|
|
30
|
-
});
|
|
31
|
-
const render = (onAfterInit) => {
|
|
32
|
-
return cy.wrap(null).then(() => {
|
|
33
|
-
const customizationContext = {
|
|
34
|
-
filters: { enabled: true },
|
|
35
|
-
feedback: { title: 'TITLE' },
|
|
36
|
-
};
|
|
37
|
-
const component = (_jsx(ChatbotComponent, { style: {
|
|
38
|
-
height: '100vh',
|
|
39
|
-
width: '100%',
|
|
40
|
-
maxWidth: '100vh',
|
|
41
|
-
overflowX: 'hidden',
|
|
42
|
-
}, customizations: customizationContext }));
|
|
43
|
-
const wrappedComponent = wrapperComponent ? wrapperComponent(component) : component;
|
|
44
|
-
return testRenderWrapperChatbot(container, wrappedComponent, onAfterInit);
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
const doAskBot = (message) => {
|
|
48
|
-
ChatUiSelectors.chatInput.type(`${message}{enter}`, { delay: 0 });
|
|
49
|
-
};
|
|
50
|
-
const doTriggerFile = () => {
|
|
51
|
-
chatbotUiStore.setFilePickerEnabled(true);
|
|
52
|
-
cy.then(() => {
|
|
53
|
-
ChatUiSelectors.chatUploadFile.should('be.visible');
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
it('should render the chatbot component', () => {
|
|
57
|
-
mockAskBotApi("Hello! I'm chatbot mocked response!!!");
|
|
58
|
-
render();
|
|
59
|
-
// Pick filter
|
|
60
|
-
ChatUiSelectors.chatbotFilterButton.first().click();
|
|
61
|
-
ChatUiSelectors.chatbotFilterOptions.find('label').first().click();
|
|
62
|
-
ChatUiSelectors.chatbotFilterButton.first().click();
|
|
63
|
-
// Ask chatbot
|
|
64
|
-
doAskBot('Hello, Chatbot!');
|
|
65
|
-
doAskBot('Hello, Chatbot! Hello, Chatbot! Hello, Chatbot! Hello, Chatbot! Hello, Chatbot!');
|
|
66
|
-
doTriggerFile();
|
|
67
|
-
// Check if the message is sent
|
|
68
|
-
cy.get('@askBot').should('have.been.calledTwice');
|
|
69
|
-
});
|
|
70
|
-
describe('with error handling', () => {
|
|
71
|
-
const mockAskBotApiError = (errorMessage) => {
|
|
72
|
-
api.postMessage = cy.stub().as('askBot').rejects(new Error(errorMessage));
|
|
73
|
-
};
|
|
74
|
-
it('should react on send message API error', () => {
|
|
75
|
-
mockAskBotApiError('Chatbot API error');
|
|
76
|
-
render();
|
|
77
|
-
doAskBot('Hello, Chatbot!');
|
|
78
|
-
cy.then(() => {
|
|
79
|
-
ChatUiSelectors.chatMessageFooter
|
|
80
|
-
.last()
|
|
81
|
-
.should('be.visible')
|
|
82
|
-
.should('contain.text', 'Message not delivered. Retry');
|
|
83
|
-
const errorBanner = ChatUiSelectors.chatError.should('be.visible').within(() => {
|
|
84
|
-
errorBanner
|
|
85
|
-
.find('.Banner__text > .Banner__title, [class^="_title-container"]')
|
|
86
|
-
.should('contain.text', 'Chat Error');
|
|
87
|
-
ChatUiSelectors.chatErrorText
|
|
88
|
-
.should('be.visible')
|
|
89
|
-
.should('contain.text', 'Failed to send message');
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
cy.then(() => {
|
|
93
|
-
mockAskBotApi("Hello! I'm chatbot mocked response!!!");
|
|
94
|
-
ChatUiSelectors.chatMessageErrorRetry.click();
|
|
95
|
-
ChatUiSelectors.chatMessageContentAgent
|
|
96
|
-
.should('be.visible')
|
|
97
|
-
.should('contain.text', "Hello! I'm chatbot mocked response!!!");
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
describe('with message feedback', () => {
|
|
102
|
-
it('should render the chatbot component', () => {
|
|
103
|
-
mockAskBotApi("Hello! I'm chatbot mocked response!!!");
|
|
104
|
-
render();
|
|
105
|
-
doAskBot('Hello!');
|
|
106
|
-
ChatUiSelectors.chatbotMessageFeedbackThumbsUp.should('be.visible').click();
|
|
107
|
-
cy.get('@askBotFeedback').should('have.been.calledOnce');
|
|
108
|
-
ChatUiSelectors.chatbotMessageFeedbackSuccess
|
|
109
|
-
.should('be.visible')
|
|
110
|
-
.should('contain.text', 'Thanks for your feedback.');
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
//# sourceMappingURL=chatbot.shared-tests.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot.shared-tests.js","sourceRoot":"","sources":["../../../src/tests/titan-chatbot-ui/chatbot.shared-tests.tsx"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{ ReactNode } from 'react';
|
|
3
|
-
export declare const testInitContainerChatbot: () => Container;
|
|
4
|
-
export declare const testRenderWrapperChatbot: (container: Container, component: ReactNode, onAfterInit?: () => void) => Promise<void>;
|
|
5
|
-
//# sourceMappingURL=test-utils-chatbot.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-utils-chatbot.d.ts","sourceRoot":"","sources":["../../src/utils/test-utils-chatbot.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAW,MAAM,yBAAyB,CAAC;AAa7D,OAAO,EAAM,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtC,eAAO,MAAM,wBAAwB,iBAepC,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACjC,WAAW,SAAS,EACpB,WAAW,SAAS,EACpB,cAAa,MAAM,IAAe,kBAmCrC,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Log } from '@servicetitan/log-service';
|
|
3
|
-
import { Container, provide } from '@servicetitan/react-ioc';
|
|
4
|
-
import { ChatParticipantIcon } from '@servicetitan/titan-chat-ui-common';
|
|
5
|
-
import { CHATBOT_API_CLIENT, CHATBOT_UI_BACKEND_STORE_TOKEN, CHATBOT_UI_STORE_TOKEN, ChatbotUiBackendStore, ChatbotUiStore, } from '@servicetitan/titan-chatbot-api';
|
|
6
|
-
import { mount } from 'cypress/react';
|
|
7
|
-
import { CypressMocks } from '..';
|
|
8
|
-
export const testInitContainerChatbot = () => {
|
|
9
|
-
const rootContainer = new Container();
|
|
10
|
-
const container = new Container();
|
|
11
|
-
container.parent = rootContainer;
|
|
12
|
-
container.bind(Log).to(CypressMocks.LogMock).inSingletonScope();
|
|
13
|
-
container
|
|
14
|
-
.bind(CHATBOT_API_CLIENT)
|
|
15
|
-
.to(CypressMocks.ChatbotApiClientMock)
|
|
16
|
-
.inSingletonScope();
|
|
17
|
-
container.bind(CHATBOT_UI_STORE_TOKEN).to(ChatbotUiStore).inSingletonScope();
|
|
18
|
-
container
|
|
19
|
-
.bind(CHATBOT_UI_BACKEND_STORE_TOKEN)
|
|
20
|
-
.to(ChatbotUiBackendStore)
|
|
21
|
-
.inSingletonScope();
|
|
22
|
-
return container;
|
|
23
|
-
};
|
|
24
|
-
export const testRenderWrapperChatbot = async (container, component, onAfterInit = () => { }) => {
|
|
25
|
-
const log = container.get(Log);
|
|
26
|
-
const chatbotApiClient = container.get(CHATBOT_API_CLIENT);
|
|
27
|
-
const chatbotUiStore = container.get(CHATBOT_UI_STORE_TOKEN);
|
|
28
|
-
const chatbotUiBackendStore = container.get(CHATBOT_UI_BACKEND_STORE_TOKEN);
|
|
29
|
-
chatbotUiBackendStore.subscribe();
|
|
30
|
-
await chatbotUiStore.run({
|
|
31
|
-
agentName: 'EchoBot',
|
|
32
|
-
agentIcon: ChatParticipantIcon.Bot,
|
|
33
|
-
});
|
|
34
|
-
onAfterInit === null || onAfterInit === void 0 ? void 0 : onAfterInit();
|
|
35
|
-
const RenderWrapper = provide({
|
|
36
|
-
singletons: [
|
|
37
|
-
{
|
|
38
|
-
provide: Log,
|
|
39
|
-
useValue: log,
|
|
40
|
-
},
|
|
41
|
-
{ provide: CHATBOT_API_CLIENT, useValue: chatbotApiClient },
|
|
42
|
-
{
|
|
43
|
-
provide: CHATBOT_UI_STORE_TOKEN,
|
|
44
|
-
useValue: chatbotUiStore,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
provide: CHATBOT_UI_BACKEND_STORE_TOKEN,
|
|
48
|
-
useValue: chatbotUiBackendStore,
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
})(() => component);
|
|
52
|
-
RenderWrapper.displayName = 'RenderWrapper';
|
|
53
|
-
mount(_jsx(RenderWrapper, {}));
|
|
54
|
-
};
|
|
55
|
-
//# sourceMappingURL=test-utils-chatbot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-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IACA,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAO,GAAG,CAAC,CAAC;IACrC,MAAM,gBAAgB,GAAG,SAAS,CAAC,GAAG,CAAoB,kBAAkB,CAAC,CAAC;IAC9E,MAAM,cAAc,GAAG,SAAS,CAAC,GAAG,CAAkB,sBAAsB,CAAC,CAAC;IAC9E,MAAM,qBAAqB,GAAG,SAAS,CAAC,GAAG,CACvC,8BAA8B,CACjC,CAAC;IAEF,qBAAqB,CAAC,SAAS,EAAE,CAAC;IAClC,MAAM,cAAc,CAAC,GAAG,CAAC;QACrB,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE,mBAAmB,CAAC,GAAG;KACrC,CAAC,CAAC;IACH,WAAW,aAAX,WAAW,uBAAX,WAAW,EAAI,CAAC;IAEhB,MAAM,aAAa,GAAO,OAAO,CAAC;QAC9B,UAAU,EAAE;YACR;gBACI,OAAO,EAAE,GAAG;gBACZ,QAAQ,EAAE,GAAG;aAChB;YACD,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,gBAAgB,EAAE;YAC3D;gBACI,OAAO,EAAE,sBAAsB;gBAC/B,QAAQ,EAAE,cAAc;aAC3B;YACD;gBACI,OAAO,EAAE,8BAA8B;gBACvC,QAAQ,EAAE,qBAAqB;aAClC;SACJ;KACJ,CAAC,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IACpB,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC;IAC5C,KAAK,CAAC,KAAC,aAAa,KAAG,CAAC,CAAC;AAC7B,CAAC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Container } from '@servicetitan/react-ioc';
|
|
2
|
-
import { IChatUiBackendStore, IChatUiStore } from '@servicetitan/titan-chat-ui-common';
|
|
3
|
-
import { ReactNode } from 'react';
|
|
4
|
-
export declare const testInitContainer: () => Container;
|
|
5
|
-
export declare const testRenderWrapper: (chatUiStore: IChatUiStore, chatUiBackendStore: IChatUiBackendStore, component: ReactNode, onAfterInit?: () => void) => Promise<void>;
|
|
6
|
-
//# sourceMappingURL=test-utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../src/utils/test-utils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAW,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAMH,mBAAmB,EACnB,YAAY,EACf,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAM,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtC,eAAO,MAAM,iBAAiB,iBAU7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC1B,aAAa,YAAY,EACzB,oBAAoB,mBAAmB,EACvC,WAAW,SAAS,EACpB,cAAa,MAAM,IAAe,kBAsBrC,CAAC"}
|
package/dist/utils/test-utils.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Container, provide } from '@servicetitan/react-ioc';
|
|
3
|
-
import { CHAT_UI_BACKEND_STORE_TOKEN, CHAT_UI_STORE_TOKEN, ChatParticipantIcon, ChatUiBackendEchoStore, ChatUiStore, } from '@servicetitan/titan-chat-ui-common';
|
|
4
|
-
import { mount } from 'cypress/react';
|
|
5
|
-
export const testInitContainer = () => {
|
|
6
|
-
const rootContainer = new Container();
|
|
7
|
-
const container = new Container();
|
|
8
|
-
container.parent = rootContainer;
|
|
9
|
-
container.bind(CHAT_UI_STORE_TOKEN).to(ChatUiStore).inSingletonScope();
|
|
10
|
-
container
|
|
11
|
-
.bind(CHAT_UI_BACKEND_STORE_TOKEN)
|
|
12
|
-
.to(ChatUiBackendEchoStore)
|
|
13
|
-
.inSingletonScope();
|
|
14
|
-
return container;
|
|
15
|
-
};
|
|
16
|
-
export const testRenderWrapper = async (chatUiStore, chatUiBackendStore, component, onAfterInit = () => { }) => {
|
|
17
|
-
chatUiBackendStore.subscribe();
|
|
18
|
-
await chatUiStore.run({
|
|
19
|
-
agentName: 'EchoBot',
|
|
20
|
-
agentIcon: ChatParticipantIcon.Bot,
|
|
21
|
-
});
|
|
22
|
-
onAfterInit === null || onAfterInit === void 0 ? void 0 : onAfterInit();
|
|
23
|
-
const RenderWrapper = provide({
|
|
24
|
-
singletons: [
|
|
25
|
-
{
|
|
26
|
-
provide: CHAT_UI_STORE_TOKEN,
|
|
27
|
-
useValue: chatUiStore,
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
provide: CHAT_UI_BACKEND_STORE_TOKEN,
|
|
31
|
-
useValue: chatUiBackendStore,
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
})(() => component);
|
|
35
|
-
RenderWrapper.displayName = 'RenderWrapper';
|
|
36
|
-
mount(_jsx(RenderWrapper, {}));
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=test-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-utils.js","sourceRoot":"","sources":["../../src/utils/test-utils.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EACH,2BAA2B,EAC3B,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,WAAW,GAGd,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAClC,MAAM,aAAa,GAAG,IAAI,SAAS,EAAE,CAAC;IACtC,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;IAClC,SAAS,CAAC,MAAM,GAAG,aAAa,CAAC;IACjC,SAAS,CAAC,IAAI,CAAe,mBAAmB,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACrF,SAAS;SACJ,IAAI,CAAsB,2BAA2B,CAAC;SACtD,EAAE,CAAC,sBAAsB,CAAC;SAC1B,gBAAgB,EAAE,CAAC;IACxB,OAAO,SAAS,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAClC,WAAyB,EACzB,kBAAuC,EACvC,SAAoB,EACpB,cAA0B,GAAG,EAAE,GAAE,CAAC,EACpC,EAAE;IACA,kBAAkB,CAAC,SAAS,EAAE,CAAC;IAC/B,MAAM,WAAW,CAAC,GAAG,CAAC;QAClB,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE,mBAAmB,CAAC,GAAG;KACrC,CAAC,CAAC;IACH,WAAW,aAAX,WAAW,uBAAX,WAAW,EAAI,CAAC;IAChB,MAAM,aAAa,GAAO,OAAO,CAAC;QAC9B,UAAU,EAAE;YACR;gBACI,OAAO,EAAE,mBAAmB;gBAC5B,QAAQ,EAAE,WAAW;aACxB;YACD;gBACI,OAAO,EAAE,2BAA2B;gBACpC,QAAQ,EAAE,kBAAkB;aAC/B;SACJ;KACJ,CAAC,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IACpB,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC;IAC5C,KAAK,CAAC,KAAC,aAAa,KAAG,CAAC,CAAC;AAC7B,CAAC,CAAC"}
|
package/src/tests/index.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export { runChatErrorSharedTests } from './titan-chat-ui/chat-error.shared-tests';
|
|
2
|
-
export { runChatInputSharedTests } from './titan-chat-ui/chat-input.shared-tests';
|
|
3
|
-
export { runChatLogSharedTests } from './titan-chat-ui/chat-log.shared-tests';
|
|
4
|
-
export { runChatMessagesSharedTests } from './titan-chat-ui/chat-messages.shared-tests';
|
|
5
|
-
export { runChatNotificationsTests } from './titan-chat-ui/chat-notifications.shared-tests';
|
|
6
|
-
export { runChatSharedTests } from './titan-chat-ui/chat.shared-tests';
|
|
7
|
-
export { runChatTimerTests } from './titan-chat-ui/chat-timer.shared-tests';
|
|
8
|
-
export { runMessageContentFileSharedTests } from './titan-chat-ui/message-content-file.shared-tests';
|
|
9
|
-
export { runMessageUserSharedTests } from './titan-chat-ui/message-user.shared-tests';
|
|
10
|
-
export { runMessageTypingSharedTests } from './titan-chat-ui/message-typing.shared-tests';
|
|
11
|
-
export { runMessageAgentSharedTests } from './titan-chat-ui/message-agent.shared-tests';
|
|
12
|
-
export { runMessageSystemSharedTests } from './titan-chat-ui/message-system.shared-tests';
|
|
13
|
-
export { runMessageTimeoutSharedTests } from './titan-chat-ui/message-timeout.shared-tests';
|
|
14
|
-
export { runChatInputFileSharedTests } from './titan-chat-ui/chat-input-file.shared-tests';
|
|
15
|
-
|
|
16
|
-
export { runChatbotRestartDialogSharedTests } from './titan-chatbot-ui/chatbot-restart-dialog.shared-tests';
|
|
17
|
-
export { runChatbotRestartLinkSharedTests } from './titan-chatbot-ui/chatbot-restart-link.shared-tests';
|
|
18
|
-
export { runChatbotSharedTests } from './titan-chatbot-ui/chatbot.shared-tests';
|
|
19
|
-
export { runChatbotTitanChatbotSharedTests } from './titan-chatbot-ui/chatbot-titan-chatbot.shared-tests';
|
|
20
|
-
export { runChatbotLiveSharedTests } from './titan-chatbot-ui/chatbot-live.shared-tests';
|
|
21
|
-
export { runChatbotHelpCenterSharedTests } from './titan-chatbot-ui/chatbot-help-center.shared-tests';
|
|
22
|
-
export { runChatbotFiltersSharedTests } from './titan-chatbot-ui/chatbot-filters.shared-tests';
|
|
23
|
-
export { runChatbotMessageTypingSharedTests } from './titan-chatbot-ui/chatbot-message-typing.shared-tests';
|
|
24
|
-
export { runChatbotMessageAnswerReadonlySharedTests } from './titan-chatbot-ui/chatbot-message-answer-readonly.shared-tests';
|
|
25
|
-
export { runChatbotMessageAnswerSharedTests } from './titan-chatbot-ui/chatbot-message-answer.shared-tests';
|
|
26
|
-
export { runChatbotLinksSharedTests } from './titan-chatbot-ui/chatbot-links.shared-tests';
|
|
27
|
-
export { runChatbotSessionFeedbackModalSharedTests } from './titan-chatbot-ui/chatbot-session-feedback-modal.shared-tests';
|
|
28
|
-
export { runChatbotMessageFeedbackFormSharedTests } from './titan-chatbot-ui/chatbot-message-feedback-form.shared-tests';
|
|
29
|
-
export { runChatbotMessageFeedbackFormGuardrailSharedTests } from './titan-chatbot-ui/chatbot-message-feedback-form-guardrail.shared-tests';
|
|
30
|
-
export { runChatbotMessageFeedbackPopoverSharedTests } from './titan-chatbot-ui/chatbot-message-feedback-popover.shared-tests';
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { Container } from '@servicetitan/react-ioc';
|
|
2
|
-
import {
|
|
3
|
-
CHAT_UI_BACKEND_STORE_TOKEN,
|
|
4
|
-
CHAT_UI_STORE_TOKEN,
|
|
5
|
-
ChatUiBackendEchoStore,
|
|
6
|
-
IChatUiBackendStore,
|
|
7
|
-
IChatUiStore,
|
|
8
|
-
} from '@servicetitan/titan-chat-ui-common';
|
|
9
|
-
import { FC } from 'react';
|
|
10
|
-
import { ChatUiSelectors } from '../../utils/chat-ui-selectors';
|
|
11
|
-
import { testInitContainer, testRenderWrapper } from '../../utils/test-utils';
|
|
12
|
-
|
|
13
|
-
export function runChatErrorSharedTests(ChatErrorComponent: FC) {
|
|
14
|
-
let container: Container;
|
|
15
|
-
let chatUiStore: IChatUiStore;
|
|
16
|
-
let chatUiBackendStore: IChatUiBackendStore;
|
|
17
|
-
|
|
18
|
-
beforeEach(() => {
|
|
19
|
-
container = testInitContainer();
|
|
20
|
-
chatUiStore = container.get<IChatUiStore>(CHAT_UI_STORE_TOKEN);
|
|
21
|
-
chatUiBackendStore = container.get<ChatUiBackendEchoStore>(CHAT_UI_BACKEND_STORE_TOKEN);
|
|
22
|
-
cy.viewport(800, 800);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
const render = (onAfterInit?: () => void) =>
|
|
26
|
-
cy
|
|
27
|
-
.wrap(null)
|
|
28
|
-
.then(() =>
|
|
29
|
-
testRenderWrapper(
|
|
30
|
-
chatUiStore,
|
|
31
|
-
chatUiBackendStore,
|
|
32
|
-
<ChatErrorComponent />,
|
|
33
|
-
onAfterInit
|
|
34
|
-
)
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
it('should render', () => {
|
|
38
|
-
render(() => {
|
|
39
|
-
cy.spy(chatUiStore, 'recover').as('recoverSpy');
|
|
40
|
-
chatUiStore.setError(
|
|
41
|
-
'Custom error message Custom error message Custom error message Custom error message Custom error message Custom error message Custom error message',
|
|
42
|
-
{
|
|
43
|
-
title: 'Custom error title',
|
|
44
|
-
recoverStrategy: {
|
|
45
|
-
recoverButtonTitle: 'Recover button',
|
|
46
|
-
},
|
|
47
|
-
data: { customData: 'Custom data' },
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
ChatUiSelectors.chatError.should('contain.text', 'Custom error title');
|
|
53
|
-
ChatUiSelectors.chatErrorText.should(
|
|
54
|
-
'have.text',
|
|
55
|
-
'Custom error message Custom error message Custom error message Custom error message Custom error message Custom error message Custom error message'
|
|
56
|
-
);
|
|
57
|
-
ChatUiSelectors.chatErrorRecover.should('have.text', 'Recover button').click();
|
|
58
|
-
cy.get('@recoverSpy').should('have.been.calledOnce');
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it('should not render when no error is set', () => {
|
|
62
|
-
render();
|
|
63
|
-
ChatUiSelectors.chatError.should('not.exist');
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it('should render error without recover button when no recover strategy is provided', () => {
|
|
67
|
-
render(() => {
|
|
68
|
-
chatUiStore.setError('Error without recovery', {
|
|
69
|
-
title: 'Non-recoverable error',
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
ChatUiSelectors.chatError.should('be.visible');
|
|
74
|
-
ChatUiSelectors.chatError.should('contain.text', 'Non-recoverable error');
|
|
75
|
-
ChatUiSelectors.chatErrorText.should('have.text', 'Error without recovery');
|
|
76
|
-
ChatUiSelectors.chatErrorRecover.should('not.exist');
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it('should render with default title when no title is provided', () => {
|
|
80
|
-
render(() => {
|
|
81
|
-
chatUiStore.setError('Error message without title');
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
ChatUiSelectors.chatError.should('be.visible');
|
|
85
|
-
ChatUiSelectors.chatErrorText.should('have.text', 'Error message without title');
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
it('should handle multiline error messages correctly', () => {
|
|
89
|
-
render(() => {
|
|
90
|
-
chatUiStore.setError('First line\nSecond line\nThird line', {
|
|
91
|
-
title: 'Multiline Error',
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
ChatUiSelectors.chatError.should('be.visible');
|
|
96
|
-
ChatUiSelectors.chatError.should('contain.text', 'Multiline Error');
|
|
97
|
-
ChatUiSelectors.chatErrorText.should('contain.text', 'First line');
|
|
98
|
-
ChatUiSelectors.chatErrorText.should('contain.text', 'Second line');
|
|
99
|
-
ChatUiSelectors.chatErrorText.should('contain.text', 'Third line');
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
it('should update error content when error changes', () => {
|
|
103
|
-
render(() => {
|
|
104
|
-
chatUiStore.setError('First error', { title: 'First Title' });
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
ChatUiSelectors.chatError.should('contain.text', 'First Title');
|
|
108
|
-
ChatUiSelectors.chatErrorText.should('have.text', 'First error');
|
|
109
|
-
|
|
110
|
-
cy.then(() => {
|
|
111
|
-
chatUiStore.setError('Second error', { title: 'Second Title' });
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
ChatUiSelectors.chatError.should('contain.text', 'Second Title');
|
|
115
|
-
ChatUiSelectors.chatErrorText.should('have.text', 'Second error');
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
it('should hide error when error is cleared', () => {
|
|
119
|
-
render(() => {
|
|
120
|
-
chatUiStore.setError('Temporary error', { title: 'Error' });
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
ChatUiSelectors.chatError.should('be.visible');
|
|
124
|
-
|
|
125
|
-
cy.then(() => {
|
|
126
|
-
chatUiStore.resetError(chatUiStore.status);
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
ChatUiSelectors.chatError.should('not.exist');
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
it('should call recover method when recover button is clicked multiple times', () => {
|
|
133
|
-
render(() => {
|
|
134
|
-
cy.spy(chatUiStore, 'recover').as('recoverSpy');
|
|
135
|
-
chatUiStore.setError('Recoverable error', {
|
|
136
|
-
title: 'Connection Error',
|
|
137
|
-
recoverStrategy: {
|
|
138
|
-
recoverButtonTitle: 'Retry Connection',
|
|
139
|
-
},
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
ChatUiSelectors.chatErrorRecover.should('have.text', 'Retry Connection');
|
|
144
|
-
ChatUiSelectors.chatErrorRecover.click();
|
|
145
|
-
cy.get('@recoverSpy').should('have.been.calledOnce');
|
|
146
|
-
|
|
147
|
-
ChatUiSelectors.chatErrorRecover.click();
|
|
148
|
-
cy.get('@recoverSpy').should('have.been.calledTwice');
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
it('should render with custom recover button text', () => {
|
|
152
|
-
render(() => {
|
|
153
|
-
chatUiStore.setError('Network timeout', {
|
|
154
|
-
title: 'Connection Failed',
|
|
155
|
-
recoverStrategy: {
|
|
156
|
-
recoverButtonTitle: 'Try Again Now',
|
|
157
|
-
},
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
ChatUiSelectors.chatErrorRecover.should('have.text', 'Try Again Now');
|
|
162
|
-
ChatUiSelectors.chatErrorRecover.should('be.visible');
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
it('should maintain error data when provided', () => {
|
|
166
|
-
render(() => {
|
|
167
|
-
chatUiStore.setError('Error with data', {
|
|
168
|
-
title: 'Data Error',
|
|
169
|
-
data: { errorCode: 500, timestamp: '2023-10-01' },
|
|
170
|
-
});
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
ChatUiSelectors.chatError.should('be.visible');
|
|
174
|
-
ChatUiSelectors.chatError.should('contain.text', 'Data Error');
|
|
175
|
-
ChatUiSelectors.chatErrorText.should('have.text', 'Error with data');
|
|
176
|
-
|
|
177
|
-
// Verify the error data is accessible through the store
|
|
178
|
-
cy.then(() => {
|
|
179
|
-
expect(chatUiStore.error?.data).to.deep.equal({
|
|
180
|
-
errorCode: 500,
|
|
181
|
-
timestamp: '2023-10-01',
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
}
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { Container } from '@servicetitan/react-ioc';
|
|
2
|
-
import {
|
|
3
|
-
CHAT_UI_BACKEND_STORE_TOKEN,
|
|
4
|
-
CHAT_UI_STORE_TOKEN,
|
|
5
|
-
ChatUiBackendEchoStore,
|
|
6
|
-
IChatUiBackendStore,
|
|
7
|
-
IChatUiStore,
|
|
8
|
-
} from '@servicetitan/titan-chat-ui-common';
|
|
9
|
-
import { FC } from 'react';
|
|
10
|
-
import { ChatUiSelectors } from '../../utils/chat-ui-selectors';
|
|
11
|
-
import { testInitContainer, testRenderWrapper } from '../../utils/test-utils';
|
|
12
|
-
|
|
13
|
-
interface ChatInputFileSharedTestsOptions {
|
|
14
|
-
isAnvil2?: boolean;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function runChatInputFileSharedTests(
|
|
18
|
-
ChatInputFileComponent: FC,
|
|
19
|
-
options: ChatInputFileSharedTestsOptions = {}
|
|
20
|
-
) {
|
|
21
|
-
let container: Container;
|
|
22
|
-
let chatUiStore: IChatUiStore;
|
|
23
|
-
let chatUiBackendStore: IChatUiBackendStore;
|
|
24
|
-
|
|
25
|
-
beforeEach(() => {
|
|
26
|
-
container = testInitContainer();
|
|
27
|
-
chatUiStore = container.get<IChatUiStore>(CHAT_UI_STORE_TOKEN);
|
|
28
|
-
chatUiBackendStore = container.get<ChatUiBackendEchoStore>(CHAT_UI_BACKEND_STORE_TOKEN);
|
|
29
|
-
cy.viewport(800, 800);
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
const render = (onAfterInit?: () => void) =>
|
|
33
|
-
cy
|
|
34
|
-
.wrap(null)
|
|
35
|
-
.then(() =>
|
|
36
|
-
testRenderWrapper(
|
|
37
|
-
chatUiStore,
|
|
38
|
-
chatUiBackendStore,
|
|
39
|
-
<ChatInputFileComponent />,
|
|
40
|
-
onAfterInit
|
|
41
|
-
)
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
const selectFile = (fileName: string, mimeType = 'text/plain', contents = '') => {
|
|
45
|
-
cy.get('input[type="file"]').selectFile(
|
|
46
|
-
{
|
|
47
|
-
contents: Cypress.Buffer.from(contents),
|
|
48
|
-
fileName,
|
|
49
|
-
mimeType,
|
|
50
|
-
lastModified: Date.now(),
|
|
51
|
-
},
|
|
52
|
-
{ force: true }
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
it('should render the upload button when no file is selected', () => {
|
|
57
|
-
render(() => {
|
|
58
|
-
chatUiStore.setFilePickerEnabled(true);
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
ChatUiSelectors.chatUploadFile.should('be.visible');
|
|
62
|
-
|
|
63
|
-
if (options.isAnvil2) {
|
|
64
|
-
cy.contains('e.g. Screenshot of issue').should('be.visible');
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it('should not render when file picker is disabled', () => {
|
|
69
|
-
render(() => {
|
|
70
|
-
chatUiStore.setFilePickerEnabled(false);
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
ChatUiSelectors.chatUploadFile.should('not.exist');
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it('should display the file name and action buttons after selecting a file', () => {
|
|
77
|
-
render(() => {
|
|
78
|
-
chatUiStore.setFilePickerEnabled(true);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
const fileName = 'test-image.png';
|
|
82
|
-
selectFile(fileName);
|
|
83
|
-
|
|
84
|
-
// Verify the file name is displayed
|
|
85
|
-
ChatUiSelectors.chatUploadFile.should('be.visible').and('contain', fileName);
|
|
86
|
-
if (options.isAnvil2) {
|
|
87
|
-
ChatUiSelectors.chatUploadFileEdit.should('be.visible');
|
|
88
|
-
ChatUiSelectors.chatUploadFileDelete.should('be.visible');
|
|
89
|
-
ChatUiSelectors.chatUploadFileBtn.should('not.exist');
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// Verify the store received the file
|
|
93
|
-
cy.wrap(chatUiStore).its('file.displayName').should('eq', fileName);
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
if (options.isAnvil2) {
|
|
97
|
-
it('should allow replacing an already selected file', () => {
|
|
98
|
-
const initialFileName = 'test-image.png';
|
|
99
|
-
const newFileName = 'another-document.pdf';
|
|
100
|
-
|
|
101
|
-
render(() => {
|
|
102
|
-
chatUiStore.setFilePickerEnabled(true);
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
selectFile(initialFileName);
|
|
106
|
-
ChatUiSelectors.chatUploadFileName.should('be.visible').and('contain', initialFileName);
|
|
107
|
-
cy.wrap(chatUiStore).its('file.displayName').should('eq', initialFileName);
|
|
108
|
-
|
|
109
|
-
selectFile(newFileName, 'application/pdf');
|
|
110
|
-
ChatUiSelectors.chatUploadFileName.should('be.visible').and('contain', newFileName);
|
|
111
|
-
cy.wrap(chatUiStore).its('file.displayName').should('eq', newFileName);
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
it('should allow deleting a selected file', () => {
|
|
115
|
-
const fileName = 'test-image.png';
|
|
116
|
-
|
|
117
|
-
render(() => {
|
|
118
|
-
chatUiStore.setFilePickerEnabled(true);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
selectFile(fileName);
|
|
122
|
-
|
|
123
|
-
// Verify the file name is displayed
|
|
124
|
-
ChatUiSelectors.chatUploadFileName.should('be.visible').and('contain', fileName);
|
|
125
|
-
|
|
126
|
-
// Click the delete button
|
|
127
|
-
ChatUiSelectors.chatUploadFileDelete.click();
|
|
128
|
-
|
|
129
|
-
// Verify the file input is reset
|
|
130
|
-
ChatUiSelectors.chatUploadFile.should('be.visible');
|
|
131
|
-
ChatUiSelectors.chatUploadFileName.should('not.exist');
|
|
132
|
-
ChatUiSelectors.chatUploadFileEdit.should('not.exist');
|
|
133
|
-
ChatUiSelectors.chatUploadFileDelete.should('not.exist');
|
|
134
|
-
|
|
135
|
-
// Verify the store no longer has a file
|
|
136
|
-
cy.wrap(chatUiStore).its('file').should('be.undefined');
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
it('should handle file selection with different file types', () => {
|
|
140
|
-
render(() => {
|
|
141
|
-
chatUiStore.setFilePickerEnabled(true);
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
// Test PDF file
|
|
145
|
-
const pdfFileName = 'test-document.pdf';
|
|
146
|
-
selectFile(pdfFileName, 'application/pdf', 'test file content');
|
|
147
|
-
|
|
148
|
-
ChatUiSelectors.chatUploadFileName.should('contain', pdfFileName);
|
|
149
|
-
cy.wrap(chatUiStore).its('file.displayName').should('eq', pdfFileName);
|
|
150
|
-
|
|
151
|
-
// Replace with image file
|
|
152
|
-
const imageFileName = 'test-image.jpg';
|
|
153
|
-
selectFile(imageFileName, 'image/jpeg');
|
|
154
|
-
|
|
155
|
-
ChatUiSelectors.chatUploadFileName.should('contain', imageFileName);
|
|
156
|
-
cy.wrap(chatUiStore).its('file.displayName').should('eq', imageFileName);
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
it('should maintain file picker state during interactions', () => {
|
|
160
|
-
render(() => {
|
|
161
|
-
chatUiStore.setFilePickerEnabled(true);
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
const fileName = 'test-file.txt';
|
|
165
|
-
selectFile(fileName);
|
|
166
|
-
|
|
167
|
-
// Verify file is selected
|
|
168
|
-
ChatUiSelectors.chatUploadFileName.should('be.visible').and('contain', fileName);
|
|
169
|
-
|
|
170
|
-
// Edit button should be visible and functional
|
|
171
|
-
ChatUiSelectors.chatUploadFileEdit.should('be.visible');
|
|
172
|
-
|
|
173
|
-
// Delete and re-upload
|
|
174
|
-
ChatUiSelectors.chatUploadFileDelete.click();
|
|
175
|
-
ChatUiSelectors.chatUploadFile.should('be.visible');
|
|
176
|
-
|
|
177
|
-
// Select file again
|
|
178
|
-
selectFile(fileName);
|
|
179
|
-
ChatUiSelectors.chatUploadFileName.should('be.visible').and('contain', fileName);
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
}
|