@patternfly/chatbot 6.8.0-prerelease.7 → 6.8.0-prerelease.9
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/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +46 -5
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +125 -16
- package/dist/cjs/CodeModal/CodeModal.js +5 -0
- package/dist/cjs/MarkdownContent/MarkdownContent.d.ts +26 -7
- package/dist/cjs/MarkdownContent/MarkdownContent.js +79 -166
- package/dist/cjs/MarkdownContent/MarkdownRenderer.d.ts +6 -0
- package/dist/cjs/MarkdownContent/MarkdownRenderer.js +187 -0
- package/dist/cjs/Message/Message.d.ts +3 -4
- package/dist/cjs/Message/Message.js +0 -2
- package/dist/cjs/MessageBox/MessageBox.d.ts +2 -0
- package/dist/cjs/MessageBox/MessageBox.js +7 -2
- package/dist/cjs/index.d.ts +0 -8
- package/dist/cjs/index.js +1 -13
- package/dist/css/main.css +77 -10
- package/dist/css/main.css.map +1 -1
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +46 -5
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +128 -19
- package/dist/esm/CodeModal/CodeModal.js +5 -0
- package/dist/esm/MarkdownContent/MarkdownContent.d.ts +26 -7
- package/dist/esm/MarkdownContent/MarkdownContent.js +52 -165
- package/dist/esm/MarkdownContent/MarkdownRenderer.d.ts +6 -0
- package/dist/esm/MarkdownContent/MarkdownRenderer.js +182 -0
- package/dist/esm/Message/Message.d.ts +3 -4
- package/dist/esm/Message/Message.js +0 -2
- package/dist/esm/MessageBox/MessageBox.d.ts +2 -0
- package/dist/esm/MessageBox/MessageBox.js +7 -2
- package/dist/esm/index.d.ts +0 -8
- package/dist/esm/index.js +0 -8
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/generate-index.js +41 -16
- package/generate-index.test.js +68 -0
- package/monaco-environment.js +45 -0
- package/package.json +20 -2
- package/patternfly-docs/content/extensions/chatbot/chatbot.md +1 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/BotMessage.tsx +1 -1
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickStart.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessage.tsx +1 -1
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/monitor-sampleapp-quickstart.ts +1 -0
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerWithExpandableGroups.tsx +104 -0
- package/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md +12 -1
- package/patternfly-docs/content/extensions/chatbot/tree-shaking.md +124 -0
- package/patternfly-docs/monaco-environment.js +45 -0
- package/patternfly-docs/patternfly-docs.css.js +6 -0
- package/src/Chatbot/Chatbot.scss +4 -0
- package/src/ChatbotContent/ChatbotContent.scss +1 -1
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.scss +52 -6
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.tsx +551 -3
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx +350 -49
- package/src/ChatbotFooter/ChatbotFooter.scss +2 -2
- package/src/ChatbotHeader/ChatbotHeader.scss +4 -0
- package/src/ChatbotModal/ChatbotModal.scss +10 -0
- package/src/ChatbotToggle/ChatbotToggle.scss +6 -0
- package/src/CodeModal/CodeModal.tsx +6 -0
- package/src/DeepThinking/DeepThinking.test.tsx +10 -12
- package/src/MarkdownContent/MarkdownContent.test.tsx +52 -5
- package/src/MarkdownContent/MarkdownContent.tsx +77 -220
- package/src/MarkdownContent/MarkdownRenderer.tsx +235 -0
- package/src/Message/Message.scss +5 -0
- package/src/Message/Message.test.tsx +5 -0
- package/src/Message/Message.tsx +3 -5
- package/src/MessageBox/MessageBox.scss +15 -1
- package/src/MessageBox/MessageBox.tsx +23 -2
- package/src/ResponseActions/ResponseActions.test.tsx +42 -48
- package/src/ToolCall/ToolCall.test.tsx +6 -9
- package/src/ToolResponse/ToolResponse.test.tsx +16 -22
- package/src/index.ts +0 -12
- package/src/test-utils/markdownTestUtils.ts +21 -0
- package/tsconfig.json +6 -1
- package/dist/cjs/AttachmentEdit/AttachmentEdit.test.d.ts +0 -1
- package/dist/cjs/AttachmentEdit/AttachmentEdit.test.js +0 -77
- package/dist/cjs/Chatbot/Chatbot.test.d.ts +0 -1
- package/dist/cjs/Chatbot/Chatbot.test.js +0 -32
- package/dist/cjs/ChatbotAlert/ChatbotAlert.test.d.ts +0 -1
- package/dist/cjs/ChatbotAlert/ChatbotAlert.test.js +0 -27
- package/dist/cjs/ChatbotContent/ChatbotContent.test.d.ts +0 -1
- package/dist/cjs/ChatbotContent/ChatbotContent.test.js +0 -22
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.d.ts +0 -1
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.js +0 -75
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.d.ts +0 -1
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +0 -277
- package/dist/cjs/ChatbotFooter/ChatbotFooter.test.d.ts +0 -1
- package/dist/cjs/ChatbotFooter/ChatbotFooter.test.js +0 -27
- package/dist/cjs/ChatbotFooter/ChatbotFooternote.test.d.ts +0 -1
- package/dist/cjs/ChatbotFooter/ChatbotFooternote.test.js +0 -87
- package/dist/cjs/ChatbotHeader/ChatbotHeader.test.d.ts +0 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeader.test.js +0 -18
- package/dist/cjs/ChatbotHeader/ChatbotHeaderActions.test.d.ts +0 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderActions.test.js +0 -18
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.test.d.ts +0 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.test.js +0 -22
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMain.test.d.ts +0 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMain.test.js +0 -18
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.test.d.ts +0 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.test.js +0 -22
- package/dist/cjs/ChatbotHeader/ChatbotHeaderNewChatButton.test.d.ts +0 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderNewChatButton.test.js +0 -22
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.d.ts +0 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.js +0 -46
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.d.ts +0 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +0 -44
- package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.test.d.ts +0 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.test.js +0 -55
- package/dist/cjs/ChatbotModal/ChatbotModal.test.d.ts +0 -1
- package/dist/cjs/ChatbotModal/ChatbotModal.test.js +0 -16
- package/dist/cjs/ChatbotToggle/ChatbotToggle.test.d.ts +0 -1
- package/dist/cjs/ChatbotToggle/ChatbotToggle.test.js +0 -64
- package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.d.ts +0 -1
- package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +0 -61
- package/dist/cjs/CodeModal/CodeModal.test.d.ts +0 -1
- package/dist/cjs/CodeModal/CodeModal.test.js +0 -34
- package/dist/cjs/Compare/Compare.test.d.ts +0 -1
- package/dist/cjs/Compare/Compare.test.js +0 -18
- package/dist/cjs/DeepThinking/DeepThinking.test.d.ts +0 -1
- package/dist/cjs/DeepThinking/DeepThinking.test.js +0 -146
- package/dist/cjs/FileDetails/FileDetails.test.d.ts +0 -1
- package/dist/cjs/FileDetails/FileDetails.test.js +0 -42
- package/dist/cjs/FileDetailsLabel/FileDetailsLabel.test.d.ts +0 -1
- package/dist/cjs/FileDetailsLabel/FileDetailsLabel.test.js +0 -79
- package/dist/cjs/FileDropZone/FileDropZone.test.d.ts +0 -1
- package/dist/cjs/FileDropZone/FileDropZone.test.js +0 -100
- package/dist/cjs/FilePreview/FilePreview.test.d.ts +0 -1
- package/dist/cjs/FilePreview/FilePreview.test.js +0 -97
- package/dist/cjs/ImagePreview/ImagePreview.test.d.ts +0 -1
- package/dist/cjs/ImagePreview/ImagePreview.test.js +0 -225
- package/dist/cjs/MarkdownContent/MarkdownContent.test.d.ts +0 -1
- package/dist/cjs/MarkdownContent/MarkdownContent.test.js +0 -192
- package/dist/cjs/Message/CodeBlockMessage/CodeBlockMessage.test.d.ts +0 -1
- package/dist/cjs/Message/CodeBlockMessage/CodeBlockMessage.test.js +0 -131
- package/dist/cjs/Message/ErrorMessage/ErrorMessage.test.d.ts +0 -1
- package/dist/cjs/Message/ErrorMessage/ErrorMessage.test.js +0 -30
- package/dist/cjs/Message/Message.test.d.ts +0 -1
- package/dist/cjs/Message/Message.test.js +0 -1128
- package/dist/cjs/Message/MessageAndActions/MessageAndActions.test.d.ts +0 -1
- package/dist/cjs/Message/MessageAndActions/MessageAndActions.test.js +0 -25
- package/dist/cjs/Message/MessageAttachments/MessageAttachmentItem.test.d.ts +0 -1
- package/dist/cjs/Message/MessageAttachments/MessageAttachmentItem.test.js +0 -25
- package/dist/cjs/Message/MessageAttachments/MessageAttachmentsContainer.test.d.ts +0 -1
- package/dist/cjs/Message/MessageAttachments/MessageAttachmentsContainer.test.js +0 -25
- package/dist/cjs/Message/MessageLoading.test.d.ts +0 -1
- package/dist/cjs/Message/MessageLoading.test.js +0 -25
- package/dist/cjs/Message/QuickResponse/QuickResponse.test.d.ts +0 -1
- package/dist/cjs/Message/QuickResponse/QuickResponse.test.js +0 -109
- package/dist/cjs/Message/QuickStarts/QuickStartTileDescription.test.d.ts +0 -1
- package/dist/cjs/Message/QuickStarts/QuickStartTileDescription.test.js +0 -76
- package/dist/cjs/Message/UserFeedback/UserFeedback.test.d.ts +0 -1
- package/dist/cjs/Message/UserFeedback/UserFeedback.test.js +0 -181
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.test.d.ts +0 -1
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.test.js +0 -243
- package/dist/cjs/MessageBar/AttachButton.test.d.ts +0 -1
- package/dist/cjs/MessageBar/AttachButton.test.js +0 -152
- package/dist/cjs/MessageBar/MessageBar.test.d.ts +0 -1
- package/dist/cjs/MessageBar/MessageBar.test.js +0 -338
- package/dist/cjs/MessageBar/SendButton.test.d.ts +0 -1
- package/dist/cjs/MessageBar/SendButton.test.js +0 -58
- package/dist/cjs/MessageBar/StopButton.test.d.ts +0 -1
- package/dist/cjs/MessageBar/StopButton.test.js +0 -58
- package/dist/cjs/MessageBox/JumpButton.test.d.ts +0 -1
- package/dist/cjs/MessageBox/JumpButton.test.js +0 -39
- package/dist/cjs/MessageBox/MessageBox.test.d.ts +0 -1
- package/dist/cjs/MessageBox/MessageBox.test.js +0 -294
- package/dist/cjs/MessageDivider/MessageDivider.test.d.ts +0 -1
- package/dist/cjs/MessageDivider/MessageDivider.test.js +0 -29
- package/dist/cjs/Onboarding/Onboarding.test.d.ts +0 -1
- package/dist/cjs/Onboarding/Onboarding.test.js +0 -80
- package/dist/cjs/PreviewAttachment/PreviewAttachment.test.d.ts +0 -1
- package/dist/cjs/PreviewAttachment/PreviewAttachment.test.js +0 -50
- package/dist/cjs/ResponseActions/ResponseActionButton.test.d.ts +0 -1
- package/dist/cjs/ResponseActions/ResponseActionButton.test.js +0 -54
- package/dist/cjs/ResponseActions/ResponseActions.test.d.ts +0 -1
- package/dist/cjs/ResponseActions/ResponseActions.test.js +0 -455
- package/dist/cjs/ResponseActions/ResponseActionsGroups.test.d.ts +0 -1
- package/dist/cjs/ResponseActions/ResponseActionsGroups.test.js +0 -25
- package/dist/cjs/Settings/SettingsForm.test.d.ts +0 -1
- package/dist/cjs/Settings/SettingsForm.test.js +0 -35
- package/dist/cjs/SourcesCard/SourcesCard.test.d.ts +0 -1
- package/dist/cjs/SourcesCard/SourcesCard.test.js +0 -39
- package/dist/cjs/SourcesCardBase/SourcesCardBase.test.d.ts +0 -1
- package/dist/cjs/SourcesCardBase/SourcesCardBase.test.js +0 -199
- package/dist/cjs/TermsOfUse/TermsOfUse.test.d.ts +0 -1
- package/dist/cjs/TermsOfUse/TermsOfUse.test.js +0 -77
- package/dist/cjs/ToolCall/ToolCall.test.d.ts +0 -1
- package/dist/cjs/ToolCall/ToolCall.test.js +0 -201
- package/dist/cjs/ToolResponse/ToolResponse.test.d.ts +0 -1
- package/dist/cjs/ToolResponse/ToolResponse.test.js +0 -184
- package/dist/cjs/__mocks__/monaco-editor.d.ts +0 -11
- package/dist/cjs/__mocks__/monaco-editor.js +0 -18
- package/dist/cjs/__mocks__/rehype-external-links.d.ts +0 -2
- package/dist/cjs/__mocks__/rehype-external-links.js +0 -4
- package/dist/cjs/__mocks__/rehype-highlight.d.ts +0 -2
- package/dist/cjs/__mocks__/rehype-highlight.js +0 -4
- package/dist/cjs/__mocks__/rehype-sanitize.d.ts +0 -2
- package/dist/cjs/__mocks__/rehype-sanitize.js +0 -4
- package/dist/cjs/__mocks__/rehype-unwrap-images.d.ts +0 -2
- package/dist/cjs/__mocks__/rehype-unwrap-images.js +0 -4
- package/dist/esm/AttachmentEdit/AttachmentEdit.test.d.ts +0 -1
- package/dist/esm/AttachmentEdit/AttachmentEdit.test.js +0 -72
- package/dist/esm/Chatbot/Chatbot.test.d.ts +0 -1
- package/dist/esm/Chatbot/Chatbot.test.js +0 -27
- package/dist/esm/ChatbotAlert/ChatbotAlert.test.d.ts +0 -1
- package/dist/esm/ChatbotAlert/ChatbotAlert.test.js +0 -22
- package/dist/esm/ChatbotContent/ChatbotContent.test.d.ts +0 -1
- package/dist/esm/ChatbotContent/ChatbotContent.test.js +0 -17
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.d.ts +0 -1
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.js +0 -70
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.d.ts +0 -1
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +0 -272
- package/dist/esm/ChatbotFooter/ChatbotFooter.test.d.ts +0 -1
- package/dist/esm/ChatbotFooter/ChatbotFooter.test.js +0 -22
- package/dist/esm/ChatbotFooter/ChatbotFooternote.test.d.ts +0 -1
- package/dist/esm/ChatbotFooter/ChatbotFooternote.test.js +0 -82
- package/dist/esm/ChatbotHeader/ChatbotHeader.test.d.ts +0 -1
- package/dist/esm/ChatbotHeader/ChatbotHeader.test.js +0 -13
- package/dist/esm/ChatbotHeader/ChatbotHeaderActions.test.d.ts +0 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderActions.test.js +0 -13
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.test.d.ts +0 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.test.js +0 -20
- package/dist/esm/ChatbotHeader/ChatbotHeaderMain.test.d.ts +0 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderMain.test.js +0 -13
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.test.d.ts +0 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.test.js +0 -20
- package/dist/esm/ChatbotHeader/ChatbotHeaderNewChatButton.test.d.ts +0 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderNewChatButton.test.js +0 -20
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.d.ts +0 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.js +0 -44
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.d.ts +0 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +0 -42
- package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.test.d.ts +0 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.test.js +0 -50
- package/dist/esm/ChatbotModal/ChatbotModal.test.d.ts +0 -1
- package/dist/esm/ChatbotModal/ChatbotModal.test.js +0 -11
- package/dist/esm/ChatbotToggle/ChatbotToggle.test.d.ts +0 -1
- package/dist/esm/ChatbotToggle/ChatbotToggle.test.js +0 -59
- package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.d.ts +0 -1
- package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +0 -56
- package/dist/esm/CodeModal/CodeModal.test.d.ts +0 -1
- package/dist/esm/CodeModal/CodeModal.test.js +0 -29
- package/dist/esm/Compare/Compare.test.d.ts +0 -1
- package/dist/esm/Compare/Compare.test.js +0 -13
- package/dist/esm/DeepThinking/DeepThinking.test.d.ts +0 -1
- package/dist/esm/DeepThinking/DeepThinking.test.js +0 -141
- package/dist/esm/FileDetails/FileDetails.test.d.ts +0 -1
- package/dist/esm/FileDetails/FileDetails.test.js +0 -37
- package/dist/esm/FileDetailsLabel/FileDetailsLabel.test.d.ts +0 -1
- package/dist/esm/FileDetailsLabel/FileDetailsLabel.test.js +0 -74
- package/dist/esm/FileDropZone/FileDropZone.test.d.ts +0 -1
- package/dist/esm/FileDropZone/FileDropZone.test.js +0 -95
- package/dist/esm/FilePreview/FilePreview.test.d.ts +0 -1
- package/dist/esm/FilePreview/FilePreview.test.js +0 -92
- package/dist/esm/ImagePreview/ImagePreview.test.d.ts +0 -1
- package/dist/esm/ImagePreview/ImagePreview.test.js +0 -220
- package/dist/esm/MarkdownContent/MarkdownContent.test.d.ts +0 -1
- package/dist/esm/MarkdownContent/MarkdownContent.test.js +0 -187
- package/dist/esm/Message/CodeBlockMessage/CodeBlockMessage.test.d.ts +0 -1
- package/dist/esm/Message/CodeBlockMessage/CodeBlockMessage.test.js +0 -126
- package/dist/esm/Message/ErrorMessage/ErrorMessage.test.d.ts +0 -1
- package/dist/esm/Message/ErrorMessage/ErrorMessage.test.js +0 -25
- package/dist/esm/Message/Message.test.d.ts +0 -1
- package/dist/esm/Message/Message.test.js +0 -1123
- package/dist/esm/Message/MessageAndActions/MessageAndActions.test.d.ts +0 -1
- package/dist/esm/Message/MessageAndActions/MessageAndActions.test.js +0 -20
- package/dist/esm/Message/MessageAttachments/MessageAttachmentItem.test.d.ts +0 -1
- package/dist/esm/Message/MessageAttachments/MessageAttachmentItem.test.js +0 -20
- package/dist/esm/Message/MessageAttachments/MessageAttachmentsContainer.test.d.ts +0 -1
- package/dist/esm/Message/MessageAttachments/MessageAttachmentsContainer.test.js +0 -20
- package/dist/esm/Message/MessageLoading.test.d.ts +0 -1
- package/dist/esm/Message/MessageLoading.test.js +0 -20
- package/dist/esm/Message/QuickResponse/QuickResponse.test.d.ts +0 -1
- package/dist/esm/Message/QuickResponse/QuickResponse.test.js +0 -104
- package/dist/esm/Message/QuickStarts/QuickStartTileDescription.test.d.ts +0 -1
- package/dist/esm/Message/QuickStarts/QuickStartTileDescription.test.js +0 -48
- package/dist/esm/Message/UserFeedback/UserFeedback.test.d.ts +0 -1
- package/dist/esm/Message/UserFeedback/UserFeedback.test.js +0 -176
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.test.d.ts +0 -1
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.test.js +0 -238
- package/dist/esm/MessageBar/AttachButton.test.d.ts +0 -1
- package/dist/esm/MessageBar/AttachButton.test.js +0 -147
- package/dist/esm/MessageBar/MessageBar.test.d.ts +0 -1
- package/dist/esm/MessageBar/MessageBar.test.js +0 -333
- package/dist/esm/MessageBar/SendButton.test.d.ts +0 -1
- package/dist/esm/MessageBar/SendButton.test.js +0 -53
- package/dist/esm/MessageBar/StopButton.test.d.ts +0 -1
- package/dist/esm/MessageBar/StopButton.test.js +0 -53
- package/dist/esm/MessageBox/JumpButton.test.d.ts +0 -1
- package/dist/esm/MessageBox/JumpButton.test.js +0 -34
- package/dist/esm/MessageBox/MessageBox.test.d.ts +0 -1
- package/dist/esm/MessageBox/MessageBox.test.js +0 -289
- package/dist/esm/MessageDivider/MessageDivider.test.d.ts +0 -1
- package/dist/esm/MessageDivider/MessageDivider.test.js +0 -24
- package/dist/esm/Onboarding/Onboarding.test.d.ts +0 -1
- package/dist/esm/Onboarding/Onboarding.test.js +0 -75
- package/dist/esm/PreviewAttachment/PreviewAttachment.test.d.ts +0 -1
- package/dist/esm/PreviewAttachment/PreviewAttachment.test.js +0 -48
- package/dist/esm/ResponseActions/ResponseActionButton.test.d.ts +0 -1
- package/dist/esm/ResponseActions/ResponseActionButton.test.js +0 -49
- package/dist/esm/ResponseActions/ResponseActions.test.d.ts +0 -1
- package/dist/esm/ResponseActions/ResponseActions.test.js +0 -450
- package/dist/esm/ResponseActions/ResponseActionsGroups.test.d.ts +0 -1
- package/dist/esm/ResponseActions/ResponseActionsGroups.test.js +0 -20
- package/dist/esm/Settings/SettingsForm.test.d.ts +0 -1
- package/dist/esm/Settings/SettingsForm.test.js +0 -33
- package/dist/esm/SourcesCard/SourcesCard.test.d.ts +0 -1
- package/dist/esm/SourcesCard/SourcesCard.test.js +0 -34
- package/dist/esm/SourcesCardBase/SourcesCardBase.test.d.ts +0 -1
- package/dist/esm/SourcesCardBase/SourcesCardBase.test.js +0 -194
- package/dist/esm/TermsOfUse/TermsOfUse.test.d.ts +0 -1
- package/dist/esm/TermsOfUse/TermsOfUse.test.js +0 -72
- package/dist/esm/ToolCall/ToolCall.test.d.ts +0 -1
- package/dist/esm/ToolCall/ToolCall.test.js +0 -196
- package/dist/esm/ToolResponse/ToolResponse.test.d.ts +0 -1
- package/dist/esm/ToolResponse/ToolResponse.test.js +0 -179
- package/dist/esm/__mocks__/monaco-editor.d.ts +0 -11
- package/dist/esm/__mocks__/monaco-editor.js +0 -18
- package/dist/esm/__mocks__/rehype-external-links.d.ts +0 -2
- package/dist/esm/__mocks__/rehype-external-links.js +0 -2
- package/dist/esm/__mocks__/rehype-highlight.d.ts +0 -2
- package/dist/esm/__mocks__/rehype-highlight.js +0 -2
- package/dist/esm/__mocks__/rehype-sanitize.d.ts +0 -2
- package/dist/esm/__mocks__/rehype-sanitize.js +0 -2
- package/dist/esm/__mocks__/rehype-unwrap-images.d.ts +0 -2
- package/dist/esm/__mocks__/rehype-unwrap-images.js +0 -2
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
-
const react_1 = require("react");
|
|
17
|
-
const react_2 = require("@testing-library/react");
|
|
18
|
-
require("@testing-library/jest-dom");
|
|
19
|
-
const MessageBox_1 = require("./MessageBox");
|
|
20
|
-
const user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
21
|
-
describe('MessageBox', () => {
|
|
22
|
-
beforeEach(() => {
|
|
23
|
-
jest.spyOn(window, 'requestAnimationFrame').mockImplementation((cb) => {
|
|
24
|
-
cb(0); // Immediately call the callback
|
|
25
|
-
return 0;
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
afterEach(() => {
|
|
29
|
-
jest.restoreAllMocks();
|
|
30
|
-
});
|
|
31
|
-
it('should render Message box', () => {
|
|
32
|
-
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Chatbot Messages" }) }));
|
|
33
|
-
expect(react_2.screen.getByText('Chatbot Messages')).toBeTruthy();
|
|
34
|
-
});
|
|
35
|
-
it('should assign ref to Message box', () => {
|
|
36
|
-
var _a, _b, _c, _d;
|
|
37
|
-
const ref = (0, react_1.createRef)();
|
|
38
|
-
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { "data-testid": "message-box", ref: ref, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
39
|
-
react_2.screen.getByText('Test message content');
|
|
40
|
-
expect(ref.current).not.toBeNull();
|
|
41
|
-
// should contain custom methods exposed by the ref
|
|
42
|
-
expect(typeof ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive)).toBe('function');
|
|
43
|
-
expect(typeof ((_b = ref.current) === null || _b === void 0 ? void 0 : _b.scrollToTop)).toBe('function');
|
|
44
|
-
expect(typeof ((_c = ref.current) === null || _c === void 0 ? void 0 : _c.scrollToBottom)).toBe('function');
|
|
45
|
-
expect((_d = ref.current) === null || _d === void 0 ? void 0 : _d.isSmartScrollActive()).toBe(false);
|
|
46
|
-
expect(ref.current).toBeInstanceOf(HTMLDivElement);
|
|
47
|
-
});
|
|
48
|
-
it('should call onScrollToBottomClick when scroll to bottom button is clicked', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
|
-
const spy = jest.fn();
|
|
50
|
-
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { onScrollToBottomClick: spy, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
51
|
-
// this forces button to show
|
|
52
|
-
const region = react_2.screen.getByRole('region');
|
|
53
|
-
Object.defineProperty(region, 'scrollHeight', { configurable: true, value: 1000 });
|
|
54
|
-
Object.defineProperty(region, 'clientHeight', { configurable: true, value: 500 });
|
|
55
|
-
Object.defineProperty(region, 'scrollTop', { configurable: true, value: 0 });
|
|
56
|
-
(0, react_2.act)(() => {
|
|
57
|
-
region.dispatchEvent(new Event('scroll'));
|
|
58
|
-
});
|
|
59
|
-
yield (0, react_2.waitFor)(() => {
|
|
60
|
-
user_event_1.default.click(react_2.screen.getByRole('button', { name: /Back to bottom/i }));
|
|
61
|
-
expect(spy).toHaveBeenCalled();
|
|
62
|
-
});
|
|
63
|
-
}));
|
|
64
|
-
it('should call onScrollToTopClick when scroll to top button is clicked', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
65
|
-
const spy = jest.fn();
|
|
66
|
-
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { onScrollToTopClick: spy, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
67
|
-
// this forces button to show
|
|
68
|
-
const region = react_2.screen.getByRole('region');
|
|
69
|
-
Object.defineProperty(region, 'scrollHeight', { configurable: true, value: 1000 });
|
|
70
|
-
Object.defineProperty(region, 'clientHeight', { configurable: true, value: 500 });
|
|
71
|
-
Object.defineProperty(region, 'scrollTop', {
|
|
72
|
-
configurable: true,
|
|
73
|
-
value: 500
|
|
74
|
-
});
|
|
75
|
-
(0, react_2.act)(() => {
|
|
76
|
-
region.dispatchEvent(new Event('scroll'));
|
|
77
|
-
});
|
|
78
|
-
yield (0, react_2.waitFor)(() => {
|
|
79
|
-
user_event_1.default.click(react_2.screen.getByRole('button', { name: /Back to top/i }));
|
|
80
|
-
expect(spy).toHaveBeenCalled();
|
|
81
|
-
});
|
|
82
|
-
}));
|
|
83
|
-
it('should call user defined onWheel, onTouchMove and onTouchEnd handlers', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
84
|
-
const ref = (0, react_1.createRef)();
|
|
85
|
-
const onWheel = jest.fn();
|
|
86
|
-
const onTouchMove = jest.fn();
|
|
87
|
-
const onTouchEnd = jest.fn();
|
|
88
|
-
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { ref: ref, enableSmartScroll: true, onWheel: onWheel, onTouchMove: onTouchMove, onTouchEnd: onTouchEnd, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
89
|
-
const element = ref.current;
|
|
90
|
-
(0, react_2.act)(() => {
|
|
91
|
-
react_2.fireEvent.wheel(element, { deltaY: 10 });
|
|
92
|
-
react_2.fireEvent.touchMove(element, { touches: [{ clientY: 700 }] });
|
|
93
|
-
react_2.fireEvent.touchEnd(element);
|
|
94
|
-
});
|
|
95
|
-
expect(onWheel).toHaveBeenCalled();
|
|
96
|
-
expect(onTouchMove).toHaveBeenCalled();
|
|
97
|
-
expect(onTouchEnd).toHaveBeenCalled();
|
|
98
|
-
}));
|
|
99
|
-
it('should scroll to the bottom when the method is called ', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
100
|
-
var _a;
|
|
101
|
-
const ref = (0, react_1.createRef)();
|
|
102
|
-
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { ref: ref, enableSmartScroll: true, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
103
|
-
const element = ref.current;
|
|
104
|
-
const scrollSpy = jest.spyOn(element, 'scrollTo');
|
|
105
|
-
(0, react_2.act)(() => {
|
|
106
|
-
var _a, _b, _c;
|
|
107
|
-
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollToBottom();
|
|
108
|
-
(_b = ref.current) === null || _b === void 0 ? void 0 : _b.scrollToBottom();
|
|
109
|
-
(_c = ref.current) === null || _c === void 0 ? void 0 : _c.scrollToBottom();
|
|
110
|
-
});
|
|
111
|
-
expect(scrollSpy).toHaveBeenCalledWith({ top: element.scrollHeight, behavior: 'smooth' });
|
|
112
|
-
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(true);
|
|
113
|
-
}));
|
|
114
|
-
it('should scroll to the top when the method is called ', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
115
|
-
var _a;
|
|
116
|
-
const ref = (0, react_1.createRef)();
|
|
117
|
-
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { ref: ref, enableSmartScroll: true, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
118
|
-
const element = ref.current;
|
|
119
|
-
const scrollSpy = jest.spyOn(element, 'scrollTo');
|
|
120
|
-
(0, react_2.act)(() => {
|
|
121
|
-
var _a;
|
|
122
|
-
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollToTop();
|
|
123
|
-
});
|
|
124
|
-
expect(scrollSpy).toHaveBeenCalledWith({ top: 0, behavior: 'smooth' });
|
|
125
|
-
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(false);
|
|
126
|
-
}));
|
|
127
|
-
it('should pause automatic scrolling when user scrolls up ', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
128
|
-
var _a, _b;
|
|
129
|
-
const ref = (0, react_1.createRef)();
|
|
130
|
-
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { ref: ref, enableSmartScroll: true, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
131
|
-
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(true);
|
|
132
|
-
const element = ref.current;
|
|
133
|
-
// Manually set scrollHeight and clientHeight for calculations
|
|
134
|
-
Object.defineProperty(element, 'scrollHeight', { configurable: true, value: 1000 });
|
|
135
|
-
Object.defineProperty(element, 'clientHeight', { configurable: true, value: 300 });
|
|
136
|
-
// Simulate scroll up by changing scrollTop
|
|
137
|
-
element.scrollTop = 200;
|
|
138
|
-
const scrollEvent = new Event('scroll', { bubbles: true });
|
|
139
|
-
(0, react_2.act)(() => {
|
|
140
|
-
element.dispatchEvent(scrollEvent);
|
|
141
|
-
});
|
|
142
|
-
expect((_b = ref.current) === null || _b === void 0 ? void 0 : _b.isSmartScrollActive()).toBe(false);
|
|
143
|
-
}));
|
|
144
|
-
it('should resume automatic scrolling when user scrolls down to the bottom using scroll event', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
145
|
-
var _a, _b;
|
|
146
|
-
jest.useFakeTimers();
|
|
147
|
-
const ref = (0, react_1.createRef)();
|
|
148
|
-
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { ref: ref, enableSmartScroll: true, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
149
|
-
const element = ref.current;
|
|
150
|
-
// Manually set scrollHeight and clientHeight for calculations
|
|
151
|
-
Object.defineProperty(element, 'scrollHeight', { configurable: true, value: 1000 });
|
|
152
|
-
Object.defineProperty(element, 'clientHeight', { configurable: true, value: 300 });
|
|
153
|
-
// Simulate scroll up by changing scrollTop
|
|
154
|
-
element.scrollTop = 100;
|
|
155
|
-
const scrollEvent = new Event('scroll', { bubbles: true });
|
|
156
|
-
(0, react_2.act)(() => {
|
|
157
|
-
element.dispatchEvent(scrollEvent);
|
|
158
|
-
});
|
|
159
|
-
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(false);
|
|
160
|
-
(0, react_2.act)(() => {
|
|
161
|
-
// Simulate scroll down by changing scrollTop
|
|
162
|
-
element.scrollTop = 650; // scrollHeight - scrollTop - clientHeight - DELTA_DOWN (50) = 0
|
|
163
|
-
const scrollEvent = new Event('scroll', { bubbles: true });
|
|
164
|
-
element.dispatchEvent(scrollEvent);
|
|
165
|
-
jest.advanceTimersByTime(250);
|
|
166
|
-
});
|
|
167
|
-
expect((_b = ref.current) === null || _b === void 0 ? void 0 : _b.isSmartScrollActive()).toBe(true);
|
|
168
|
-
jest.useRealTimers();
|
|
169
|
-
}));
|
|
170
|
-
it('should resume automatic scrolling when scrollToBottom method is used', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
171
|
-
var _a, _b;
|
|
172
|
-
const ref = (0, react_1.createRef)();
|
|
173
|
-
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { ref: ref, enableSmartScroll: true, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
174
|
-
const element = ref.current;
|
|
175
|
-
// Manually set scrollHeight and clientHeight for calculations
|
|
176
|
-
Object.defineProperty(element, 'scrollHeight', { configurable: true, value: 1000 });
|
|
177
|
-
Object.defineProperty(element, 'clientHeight', { configurable: true, value: 300 });
|
|
178
|
-
// Simulate scroll up by changing scrollTop
|
|
179
|
-
element.scrollTop = 100;
|
|
180
|
-
const scrollEvent = new Event('scroll', { bubbles: true });
|
|
181
|
-
(0, react_2.act)(() => {
|
|
182
|
-
element.dispatchEvent(scrollEvent);
|
|
183
|
-
});
|
|
184
|
-
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(false);
|
|
185
|
-
(0, react_2.act)(() => {
|
|
186
|
-
var _a;
|
|
187
|
-
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollToBottom({ resumeSmartScroll: true, behavior: 'auto' }); // resumes auto scroll and scrolls to bottom.
|
|
188
|
-
});
|
|
189
|
-
expect((_b = ref.current) === null || _b === void 0 ? void 0 : _b.isSmartScrollActive()).toBe(true);
|
|
190
|
-
}));
|
|
191
|
-
it('should resume automatic scrolling when mouse wheel event is used', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
192
|
-
var _a, _b;
|
|
193
|
-
const ref = (0, react_1.createRef)();
|
|
194
|
-
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { ref: ref, enableSmartScroll: true, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
195
|
-
const element = ref.current;
|
|
196
|
-
// Manually set scrollHeight and clientHeight for calculations
|
|
197
|
-
Object.defineProperty(element, 'scrollHeight', { configurable: true, value: 1000 });
|
|
198
|
-
Object.defineProperty(element, 'clientHeight', { configurable: true, value: 300 });
|
|
199
|
-
Object.defineProperty(element, 'scrollTop', { configurable: true, value: 350 });
|
|
200
|
-
const scrollEvent = new Event('scroll', { bubbles: true });
|
|
201
|
-
(0, react_2.act)(() => {
|
|
202
|
-
element.dispatchEvent(scrollEvent);
|
|
203
|
-
});
|
|
204
|
-
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(false);
|
|
205
|
-
// Simulate mouse wheel event
|
|
206
|
-
(0, react_2.act)(() => {
|
|
207
|
-
Object.defineProperty(element, 'scrollTop', { configurable: true, value: 650 });
|
|
208
|
-
react_2.fireEvent.wheel(element, { deltaY: 10 });
|
|
209
|
-
});
|
|
210
|
-
expect((_b = ref.current) === null || _b === void 0 ? void 0 : _b.isSmartScrollActive()).toBe(true);
|
|
211
|
-
}));
|
|
212
|
-
it('should resume automatic scrolling when user swipes up in touch screen', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
213
|
-
var _a, _b;
|
|
214
|
-
const ref = (0, react_1.createRef)();
|
|
215
|
-
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { ref: ref, enableSmartScroll: true, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
216
|
-
const element = ref.current;
|
|
217
|
-
// Manually set scrollHeight and clientHeight for calculations
|
|
218
|
-
Object.defineProperty(element, 'scrollHeight', { configurable: true, value: 1000 });
|
|
219
|
-
Object.defineProperty(element, 'clientHeight', { configurable: true, value: 300 });
|
|
220
|
-
Object.defineProperty(element, 'scrollTop', { configurable: true, value: 350 });
|
|
221
|
-
const scrollEvent = new Event('scroll', { bubbles: true });
|
|
222
|
-
(0, react_2.act)(() => {
|
|
223
|
-
element.dispatchEvent(scrollEvent);
|
|
224
|
-
});
|
|
225
|
-
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(false);
|
|
226
|
-
// Simulate touch event - swipe up
|
|
227
|
-
(0, react_2.act)(() => {
|
|
228
|
-
Object.defineProperty(element, 'scrollTop', { configurable: true, value: 650 });
|
|
229
|
-
react_2.fireEvent.touchStart(element, { touches: [{ clientY: 700 }] });
|
|
230
|
-
react_2.fireEvent.touchMove(element, { touches: [{ clientY: 700 }] });
|
|
231
|
-
react_2.fireEvent.touchMove(element, { touches: [{ clientY: 600 }] });
|
|
232
|
-
react_2.fireEvent.touchEnd(element);
|
|
233
|
-
});
|
|
234
|
-
expect((_b = ref.current) === null || _b === void 0 ? void 0 : _b.isSmartScrollActive()).toBe(true);
|
|
235
|
-
}));
|
|
236
|
-
it('should keep auto-scroll active during programmatic scroll to bottom', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
237
|
-
var _a, _b;
|
|
238
|
-
const ref = (0, react_1.createRef)();
|
|
239
|
-
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { ref: ref, enableSmartScroll: true, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
240
|
-
const element = ref.current;
|
|
241
|
-
Object.defineProperty(element, 'scrollHeight', { configurable: true, value: 1000 });
|
|
242
|
-
Object.defineProperty(element, 'clientHeight', { configurable: true, value: 300 });
|
|
243
|
-
Object.defineProperty(element, 'scrollTop', { configurable: true, value: 0, writable: true });
|
|
244
|
-
(0, react_2.act)(() => {
|
|
245
|
-
var _a;
|
|
246
|
-
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollToBottom({ behavior: 'smooth' });
|
|
247
|
-
});
|
|
248
|
-
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(true);
|
|
249
|
-
(0, react_2.act)(() => {
|
|
250
|
-
element.scrollTop = 500;
|
|
251
|
-
element.dispatchEvent(new Event('scroll', { bubbles: true }));
|
|
252
|
-
});
|
|
253
|
-
expect((_b = ref.current) === null || _b === void 0 ? void 0 : _b.isSmartScrollActive()).toBe(true);
|
|
254
|
-
}));
|
|
255
|
-
it('should not scroll to bottom on initial layout when the message box is at the top', () => {
|
|
256
|
-
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { enableSmartScroll: true, children: (0, jsx_runtime_1.jsx)("div", { children: "Tall message content" }) }));
|
|
257
|
-
const region = react_2.screen.getByRole('region');
|
|
258
|
-
Object.defineProperty(region, 'scrollHeight', { configurable: true, value: 1000 });
|
|
259
|
-
Object.defineProperty(region, 'clientHeight', { configurable: true, value: 300 });
|
|
260
|
-
Object.defineProperty(region, 'scrollTop', { configurable: true, value: 0, writable: true });
|
|
261
|
-
(0, react_2.act)(() => {
|
|
262
|
-
region.dispatchEvent(new Event('scroll'));
|
|
263
|
-
});
|
|
264
|
-
expect(region.scrollTop).toBe(0);
|
|
265
|
-
});
|
|
266
|
-
it('should show the bottom jump button at the top on initial load when overflowing', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
267
|
-
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { enableSmartScroll: true, children: (0, jsx_runtime_1.jsx)("div", { children: "Tall message content" }) }));
|
|
268
|
-
const region = react_2.screen.getByRole('region');
|
|
269
|
-
Object.defineProperty(region, 'scrollHeight', { configurable: true, value: 1000 });
|
|
270
|
-
Object.defineProperty(region, 'clientHeight', { configurable: true, value: 300 });
|
|
271
|
-
Object.defineProperty(region, 'scrollTop', { configurable: true, value: 0, writable: true });
|
|
272
|
-
(0, react_2.act)(() => {
|
|
273
|
-
region.dispatchEvent(new Event('scroll'));
|
|
274
|
-
});
|
|
275
|
-
yield (0, react_2.waitFor)(() => {
|
|
276
|
-
expect(react_2.screen.queryByRole('button', { name: /Back to top/i })).toBeFalsy();
|
|
277
|
-
expect(react_2.screen.getByRole('button', { name: /Back to bottom/i })).toBeTruthy();
|
|
278
|
-
});
|
|
279
|
-
}));
|
|
280
|
-
it('should hide the bottom jump button while smart scroll is actively following content', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
281
|
-
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { enableSmartScroll: true, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
282
|
-
const region = react_2.screen.getByRole('region');
|
|
283
|
-
Object.defineProperty(region, 'scrollHeight', { configurable: true, value: 1000 });
|
|
284
|
-
Object.defineProperty(region, 'clientHeight', { configurable: true, value: 300 });
|
|
285
|
-
Object.defineProperty(region, 'scrollTop', { configurable: true, value: 640, writable: true });
|
|
286
|
-
(0, react_2.act)(() => {
|
|
287
|
-
region.dispatchEvent(new Event('scroll'));
|
|
288
|
-
});
|
|
289
|
-
yield (0, react_2.waitFor)(() => {
|
|
290
|
-
expect(react_2.screen.getByRole('button', { name: /Back to top/i })).toBeTruthy();
|
|
291
|
-
expect(react_2.screen.queryByRole('button', { name: /Back to bottom/i })).toBeFalsy();
|
|
292
|
-
});
|
|
293
|
-
}));
|
|
294
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const react_1 = require("@testing-library/react");
|
|
8
|
-
require("@testing-library/jest-dom");
|
|
9
|
-
const MessageDivider_1 = __importDefault(require("./MessageDivider"));
|
|
10
|
-
describe('MessageDivider', () => {
|
|
11
|
-
beforeEach(() => {
|
|
12
|
-
jest.clearAllMocks();
|
|
13
|
-
});
|
|
14
|
-
it('should render default correctly with variant = date and content = new Date().toLocaleDateString()', () => {
|
|
15
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(MessageDivider_1.default, { "data-testid": "message-divider" }));
|
|
16
|
-
expect(react_1.screen.getByText(new Date().toLocaleDateString())).toBeInTheDocument();
|
|
17
|
-
expect(react_1.screen.getByTestId('message-divider')).toHaveClass('pf-m-divider');
|
|
18
|
-
});
|
|
19
|
-
it('should render inset variant correctly', () => {
|
|
20
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(MessageDivider_1.default, { variant: "inset", content: "test", "data-testid": "message-divider" }));
|
|
21
|
-
expect(react_1.screen.getByText('test')).toBeInTheDocument();
|
|
22
|
-
expect(react_1.screen.getByTestId('message-divider')).toHaveClass('pf-m-divider');
|
|
23
|
-
});
|
|
24
|
-
it('should render fullWidth variant correctly', () => {
|
|
25
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(MessageDivider_1.default, { variant: "fullWidth", content: "test", "data-testid": "message-divider" }));
|
|
26
|
-
expect(react_1.screen.getByText('test')).toBeInTheDocument();
|
|
27
|
-
expect(react_1.screen.getByTestId('message-divider')).not.toHaveClass('pf-m-divider');
|
|
28
|
-
});
|
|
29
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
-
const react_1 = require("@testing-library/react");
|
|
17
|
-
require("@testing-library/jest-dom");
|
|
18
|
-
const user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
19
|
-
const Onboarding_1 = __importDefault(require("./Onboarding"));
|
|
20
|
-
const handleModalToggle = jest.fn();
|
|
21
|
-
const onPrimaryAction = jest.fn();
|
|
22
|
-
const onSecondaryAction = jest.fn();
|
|
23
|
-
const body = 'Experience personalized assistance and seamless problem-solving, simplifying your journey with Red Hat every step of the way.';
|
|
24
|
-
describe('Onboarding', () => {
|
|
25
|
-
afterEach(() => {
|
|
26
|
-
jest.clearAllMocks();
|
|
27
|
-
});
|
|
28
|
-
it('should render modal correctly', () => {
|
|
29
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(Onboarding_1.default, { isModalOpen: true, onSecondaryAction: onSecondaryAction, handleModalToggle: handleModalToggle, ouiaId: "Terms", children: body }));
|
|
30
|
-
expect(react_1.screen.getByRole('heading', { name: /Onboarding/i })).toBeTruthy();
|
|
31
|
-
expect(react_1.screen.getByRole('button', { name: /Continue/i })).toBeTruthy();
|
|
32
|
-
expect(react_1.screen.getByRole('button', { name: /Skip/i })).toBeTruthy();
|
|
33
|
-
expect(react_1.screen.getByText(body)).toBeTruthy();
|
|
34
|
-
expect(react_1.screen.getByRole('dialog')).toHaveClass('pf-chatbot__onboarding-modal');
|
|
35
|
-
expect(react_1.screen.getByRole('dialog')).toHaveClass('pf-chatbot__onboarding-modal--default');
|
|
36
|
-
});
|
|
37
|
-
it('should handle image and altText props', () => {
|
|
38
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(Onboarding_1.default, { isModalOpen: true, onSecondaryAction: onSecondaryAction, handleModalToggle: handleModalToggle, headerImage: "./image.png", headerImageAltText: "Test image", children: body }));
|
|
39
|
-
expect(react_1.screen.getByRole('img')).toBeTruthy();
|
|
40
|
-
expect(react_1.screen.getByRole('img')).toHaveAttribute('alt', 'Test image');
|
|
41
|
-
});
|
|
42
|
-
it('should handle className prop', () => {
|
|
43
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(Onboarding_1.default, { isModalOpen: true, onSecondaryAction: onSecondaryAction, handleModalToggle: handleModalToggle, className: "test", children: body }));
|
|
44
|
-
expect(react_1.screen.getByRole('dialog')).toHaveClass('pf-chatbot__onboarding-modal');
|
|
45
|
-
expect(react_1.screen.getByRole('dialog')).toHaveClass('pf-chatbot__onboarding-modal--default');
|
|
46
|
-
expect(react_1.screen.getByRole('dialog')).toHaveClass('test');
|
|
47
|
-
});
|
|
48
|
-
it('should handle title prop', () => {
|
|
49
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(Onboarding_1.default, { isModalOpen: true, onSecondaryAction: onSecondaryAction, handleModalToggle: handleModalToggle, title: "Updated title", children: body }));
|
|
50
|
-
expect(react_1.screen.getByRole('heading', { name: /Updated title/i })).toBeTruthy();
|
|
51
|
-
expect(react_1.screen.queryByRole('heading', { name: /Onboarding/i })).toBeFalsy();
|
|
52
|
-
});
|
|
53
|
-
it('should handle primary button prop', () => {
|
|
54
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(Onboarding_1.default, { isModalOpen: true, onSecondaryAction: onSecondaryAction, handleModalToggle: handleModalToggle, primaryActionBtn: "First", children: body }));
|
|
55
|
-
expect(react_1.screen.getByRole('button', { name: /First/i })).toBeTruthy();
|
|
56
|
-
expect(react_1.screen.queryByRole('button', { name: /Continue/i })).toBeFalsy();
|
|
57
|
-
});
|
|
58
|
-
it('should handle secondary button prop', () => {
|
|
59
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(Onboarding_1.default, { isModalOpen: true, onSecondaryAction: onSecondaryAction, handleModalToggle: handleModalToggle, secondaryActionBtn: "Second", children: body }));
|
|
60
|
-
expect(react_1.screen.getByRole('button', { name: /Second/i })).toBeTruthy();
|
|
61
|
-
expect(react_1.screen.queryByRole('button', { name: /Skip/i })).toBeFalsy();
|
|
62
|
-
});
|
|
63
|
-
it('should handle primary button click', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(Onboarding_1.default, { isModalOpen: true, onPrimaryAction: onPrimaryAction, onSecondaryAction: onSecondaryAction, handleModalToggle: handleModalToggle, children: body }));
|
|
65
|
-
yield user_event_1.default.click(react_1.screen.getByRole('button', { name: /Continue/i }));
|
|
66
|
-
expect(onPrimaryAction).toHaveBeenCalledTimes(1);
|
|
67
|
-
expect(handleModalToggle).toHaveBeenCalledTimes(1);
|
|
68
|
-
}));
|
|
69
|
-
it('should handle secondary button click', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
70
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(Onboarding_1.default, { isModalOpen: true, onSecondaryAction: onSecondaryAction, handleModalToggle: handleModalToggle, children: body }));
|
|
71
|
-
yield user_event_1.default.click(react_1.screen.getByRole('button', { name: /Skip/i }));
|
|
72
|
-
expect(onSecondaryAction).toHaveBeenCalledTimes(1);
|
|
73
|
-
expect(handleModalToggle).not.toHaveBeenCalled();
|
|
74
|
-
}));
|
|
75
|
-
it('should handle isCompact prop', () => {
|
|
76
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(Onboarding_1.default, { isModalOpen: true, onSecondaryAction: onSecondaryAction, handleModalToggle: handleModalToggle, isCompact: true, headerImage: "./image.png", headerImageAltText: "Test image", children: body }));
|
|
77
|
-
expect(react_1.screen.getByRole('dialog')).toHaveClass('pf-m-compact');
|
|
78
|
-
expect(react_1.screen.queryByRole('img')).toBeFalsy();
|
|
79
|
-
});
|
|
80
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
13
|
-
const react_1 = require("@testing-library/react");
|
|
14
|
-
require("@testing-library/jest-dom");
|
|
15
|
-
const PreviewAttachment_1 = require("./PreviewAttachment");
|
|
16
|
-
describe('PreviewAttachment', () => {
|
|
17
|
-
it('should render PreviewAttachment', () => {
|
|
18
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(PreviewAttachment_1.PreviewAttachment, { code: "Hello world", fileName: "greetings.txt", isModalOpen: true, onEdit: jest.fn(), handleModalToggle: jest.fn() }));
|
|
19
|
-
expect(react_1.screen.getByText('Preview attachment')).toBeTruthy();
|
|
20
|
-
expect(react_1.screen.getByText('greetings')).toBeTruthy();
|
|
21
|
-
expect(react_1.screen.getAllByText('TEXT')).toBeTruthy();
|
|
22
|
-
});
|
|
23
|
-
it('should call onEdit handler when edit button is pressed', () => {
|
|
24
|
-
const onEdit = jest.fn();
|
|
25
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(PreviewAttachment_1.PreviewAttachment, { code: "Hello world", fileName: "greetings.txt", isModalOpen: true, onEdit: onEdit, handleModalToggle: jest.fn() }));
|
|
26
|
-
react_1.fireEvent.click(react_1.screen.getByText('Edit'));
|
|
27
|
-
expect(onEdit).toHaveBeenCalled();
|
|
28
|
-
});
|
|
29
|
-
it('should call onDismiss handler when dismiss button is pressed', () => {
|
|
30
|
-
const onDismiss = jest.fn();
|
|
31
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(PreviewAttachment_1.PreviewAttachment, { code: "Hello world", fileName: "greetings.txt", isModalOpen: true, onEdit: jest.fn(), handleModalToggle: onDismiss }));
|
|
32
|
-
react_1.fireEvent.click(react_1.screen.getByText('Dismiss'));
|
|
33
|
-
expect(onDismiss).toHaveBeenCalled();
|
|
34
|
-
});
|
|
35
|
-
it('should render custom button text for footer actions buttons', () => {
|
|
36
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(PreviewAttachment_1.PreviewAttachment, { code: "Hello world", fileName: "greetings.txt", isModalOpen: true, onEdit: jest.fn(), handleModalToggle: jest.fn(), primaryActionButtonText: "Edit", secondaryActionButtonText: "Close" }));
|
|
37
|
-
react_1.screen.getByText('Edit');
|
|
38
|
-
react_1.screen.getByText('Close');
|
|
39
|
-
});
|
|
40
|
-
it('should render PreviewAttachment with custom classNames', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(PreviewAttachment_1.PreviewAttachment, { code: "Hello world", fileName: "greetings.txt", isModalOpen: true, onEdit: jest.fn(), handleModalToggle: jest.fn(), primaryActionButtonText: "Edit", secondaryActionButtonText: "Close", modalHeaderClassName: "custom-header-class", modalBodyClassName: "custom-body-class", modalFooterClassName: "custom-footer-class" }));
|
|
42
|
-
const modal = react_1.screen.getByRole('dialog');
|
|
43
|
-
const modalHeader = (0, react_1.within)(modal).getByRole('banner');
|
|
44
|
-
expect(modalHeader).toHaveClass('custom-header-class');
|
|
45
|
-
const modalBody = modal.querySelector('#code-modal-body');
|
|
46
|
-
expect(modalBody).toHaveClass('custom-body-class');
|
|
47
|
-
const modalfooter = (0, react_1.within)(modal).getByRole('contentinfo');
|
|
48
|
-
expect(modalfooter).toHaveClass('custom-footer-class');
|
|
49
|
-
}));
|
|
50
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
-
const react_1 = require("@testing-library/react");
|
|
17
|
-
require("@testing-library/jest-dom");
|
|
18
|
-
const user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
19
|
-
const react_icons_1 = require("@patternfly/react-icons");
|
|
20
|
-
const ResponseActionButton_1 = __importDefault(require("./ResponseActionButton"));
|
|
21
|
-
describe('ResponseActionButton', () => {
|
|
22
|
-
it('renders aria-label correctly if not clicked', () => {
|
|
23
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ResponseActionButton_1.default, { icon: (0, jsx_runtime_1.jsx)(react_icons_1.RhUiExportIcon, {}), ariaLabel: "Download", clickedAriaLabel: "Downloaded" }));
|
|
24
|
-
expect(react_1.screen.getByRole('button', { name: 'Download' })).toBeTruthy();
|
|
25
|
-
});
|
|
26
|
-
it('renders aria-label correctly if clicked', () => {
|
|
27
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ResponseActionButton_1.default, { icon: (0, jsx_runtime_1.jsx)(react_icons_1.RhUiExportIcon, {}), ariaLabel: "Download", clickedAriaLabel: "Downloaded", isClicked: true }));
|
|
28
|
-
expect(react_1.screen.getByRole('button', { name: 'Downloaded' })).toBeTruthy();
|
|
29
|
-
});
|
|
30
|
-
it('renders tooltip correctly if not clicked', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ResponseActionButton_1.default, { icon: (0, jsx_runtime_1.jsx)(react_icons_1.RhUiExportIcon, {}), tooltipContent: "Download", clickedTooltipContent: "Downloaded" }));
|
|
32
|
-
expect(react_1.screen.getByRole('button', { name: 'Download' })).toBeTruthy();
|
|
33
|
-
// clicking here just triggers the tooltip; in this button, the logic is divorced from whether it is actually clicked
|
|
34
|
-
yield user_event_1.default.click(react_1.screen.getByRole('button', { name: 'Download' }));
|
|
35
|
-
expect(react_1.screen.getByRole('tooltip', { name: 'Download' })).toBeTruthy();
|
|
36
|
-
}));
|
|
37
|
-
it('renders tooltip correctly if clicked', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ResponseActionButton_1.default, { icon: (0, jsx_runtime_1.jsx)(react_icons_1.RhUiExportIcon, {}), tooltipContent: "Download", clickedTooltipContent: "Downloaded", isClicked: true }));
|
|
39
|
-
expect(react_1.screen.getByRole('button', { name: 'Downloaded' })).toBeTruthy();
|
|
40
|
-
// clicking here just triggers the tooltip; in this button, the logic is divorced from whether it is actually clicked
|
|
41
|
-
yield user_event_1.default.click(react_1.screen.getByRole('button', { name: 'Downloaded' }));
|
|
42
|
-
expect(react_1.screen.getByRole('tooltip', { name: 'Downloaded' })).toBeTruthy();
|
|
43
|
-
}));
|
|
44
|
-
it('if clicked variant for tooltip is not supplied, it uses the default', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ResponseActionButton_1.default, { icon: (0, jsx_runtime_1.jsx)(react_icons_1.RhUiExportIcon, {}), tooltipContent: "Download", isClicked: true }));
|
|
46
|
-
// clicking here just triggers the tooltip; in this button, the logic is divorced from whether it is actually clicked
|
|
47
|
-
yield user_event_1.default.click(react_1.screen.getByRole('button', { name: 'Download' }));
|
|
48
|
-
expect(react_1.screen.getByRole('button', { name: 'Download' })).toBeTruthy();
|
|
49
|
-
}));
|
|
50
|
-
it('if clicked variant for aria label is not supplied, it uses the default', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
51
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ResponseActionButton_1.default, { icon: (0, jsx_runtime_1.jsx)(react_icons_1.RhUiExportIcon, {}), ariaLabel: "Download", isClicked: true }));
|
|
52
|
-
expect(react_1.screen.getByRole('button', { name: 'Download' })).toBeTruthy();
|
|
53
|
-
}));
|
|
54
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|