@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,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const react_1 = require("@testing-library/react");
|
|
5
|
-
const ChatbotHeaderNewChatButton_1 = require("./ChatbotHeaderNewChatButton");
|
|
6
|
-
require("@testing-library/jest-dom");
|
|
7
|
-
describe('ChatbotHeaderNewChatButton', () => {
|
|
8
|
-
it('should render ChatbotHeaderNewChatButton', () => {
|
|
9
|
-
const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderNewChatButton_1.ChatbotHeaderNewChatButton, { className: "custom-header-new-chat-button", onClick: jest.fn() }));
|
|
10
|
-
expect(container.querySelector('.custom-header-new-chat-button')).toBeTruthy();
|
|
11
|
-
});
|
|
12
|
-
it('should call onClick handler when new chat button is pressed', () => {
|
|
13
|
-
const onClick = jest.fn();
|
|
14
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderNewChatButton_1.ChatbotHeaderNewChatButton, { className: "custom-header-new-chat-button", onClick: onClick }));
|
|
15
|
-
react_1.fireEvent.click(react_1.screen.getByRole('button', { name: 'New chat' }));
|
|
16
|
-
expect(onClick).toHaveBeenCalled();
|
|
17
|
-
});
|
|
18
|
-
it('should render button with isCompact', () => {
|
|
19
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderNewChatButton_1.ChatbotHeaderNewChatButton, { "data-testid": "new-chat-button", onClick: jest.fn(), isCompact: true }));
|
|
20
|
-
expect(react_1.screen.getByTestId('new-chat-button')).toHaveClass('pf-m-compact');
|
|
21
|
-
});
|
|
22
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
@@ -1,46 +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_core_1 = require("@patternfly/react-core");
|
|
14
|
-
const react_1 = require("@testing-library/react");
|
|
15
|
-
const ChatbotHeaderOptionsDropdown_1 = require("./ChatbotHeaderOptionsDropdown");
|
|
16
|
-
require("@testing-library/jest-dom");
|
|
17
|
-
describe('ChatbotHeaderOptionsDropdown', () => {
|
|
18
|
-
const dropdownItems = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_core_1.DropdownItem, { children: "Option 1" }), (0, jsx_runtime_1.jsx)(react_core_1.DropdownItem, { children: "Option 2" }), (0, jsx_runtime_1.jsx)(react_core_1.DropdownItem, { children: "Option 3" })] }));
|
|
19
|
-
it('should render ChatbotHeaderOptionsDropdown', () => {
|
|
20
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderOptionsDropdown_1.ChatbotHeaderOptionsDropdown, { children: dropdownItems }));
|
|
21
|
-
expect(react_1.screen.getByRole('button', { name: 'Chatbot options' })).toBeTruthy();
|
|
22
|
-
});
|
|
23
|
-
it('should call onselect handler when a dropdown item is clicked', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
-
const onSelect = jest.fn();
|
|
25
|
-
const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderOptionsDropdown_1.ChatbotHeaderOptionsDropdown, { className: "custom-header-options-dropdown", onSelect: onSelect, children: dropdownItems }));
|
|
26
|
-
(0, react_1.act)(() => {
|
|
27
|
-
react_1.fireEvent.click(react_1.screen.getByRole('button', { name: 'Chatbot options' }));
|
|
28
|
-
});
|
|
29
|
-
yield (0, react_1.waitFor)(() => {
|
|
30
|
-
expect(container.querySelector('.custom-header-options-dropdown')).toBeTruthy();
|
|
31
|
-
expect(react_1.screen.getByText('Option 1'));
|
|
32
|
-
expect(react_1.screen.getByText('Option 2'));
|
|
33
|
-
expect(react_1.screen.getByText('Option 3'));
|
|
34
|
-
react_1.fireEvent.click(react_1.screen.getByText('Option 3'));
|
|
35
|
-
expect(onSelect).toHaveBeenCalled();
|
|
36
|
-
});
|
|
37
|
-
}));
|
|
38
|
-
it('should handle isCompact', () => {
|
|
39
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderOptionsDropdown_1.ChatbotHeaderOptionsDropdown, { isCompact: true, children: dropdownItems }));
|
|
40
|
-
expect(react_1.screen.getByRole('button', { name: 'Chatbot options' })).toHaveClass('pf-m-compact');
|
|
41
|
-
});
|
|
42
|
-
it('should handle toggleProps', () => {
|
|
43
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderOptionsDropdown_1.ChatbotHeaderOptionsDropdown, { isCompact: true, toggleProps: { isDisabled: true }, children: dropdownItems }));
|
|
44
|
-
expect(react_1.screen.getByRole('button', { name: /Chatbot options/i })).toBeDisabled();
|
|
45
|
-
});
|
|
46
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
@@ -1,44 +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_core_1 = require("@patternfly/react-core");
|
|
14
|
-
const react_1 = require("@testing-library/react");
|
|
15
|
-
const ChatbotHeaderSelectorDropdown_1 = require("./ChatbotHeaderSelectorDropdown");
|
|
16
|
-
require("@testing-library/jest-dom");
|
|
17
|
-
describe('ChatbotHeaderSelectorDropdown', () => {
|
|
18
|
-
const dropdownItems = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_core_1.DropdownItem, { children: "Option 1" }), (0, jsx_runtime_1.jsx)(react_core_1.DropdownItem, { children: "Option 2" }), (0, jsx_runtime_1.jsx)(react_core_1.DropdownItem, { children: "Option 3" })] }));
|
|
19
|
-
it('should render ChatbotHeaderSelectorDropdown', () => {
|
|
20
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderSelectorDropdown_1.ChatbotHeaderSelectorDropdown, { value: "Option 1", children: dropdownItems }));
|
|
21
|
-
expect(react_1.screen.getByRole('button', { name: /Select model/i })).toBeTruthy();
|
|
22
|
-
});
|
|
23
|
-
it('should call onselect handler when a dropdown item is clicked', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
-
const onSelect = jest.fn();
|
|
25
|
-
const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderSelectorDropdown_1.ChatbotHeaderSelectorDropdown, { value: "Option 1", className: "custom-header-selector-dropdown", onSelect: onSelect, children: dropdownItems }));
|
|
26
|
-
(0, react_1.act)(() => {
|
|
27
|
-
react_1.fireEvent.click(react_1.screen.getByRole('button', { name: /Select model/i }));
|
|
28
|
-
});
|
|
29
|
-
yield (0, react_1.waitFor)(() => {
|
|
30
|
-
expect(container.querySelector('.custom-header-selector-dropdown')).toBeTruthy();
|
|
31
|
-
expect(react_1.screen.getByText('Option 3'));
|
|
32
|
-
react_1.fireEvent.click(react_1.screen.getByText('Option 3'));
|
|
33
|
-
expect(onSelect).toHaveBeenCalled();
|
|
34
|
-
});
|
|
35
|
-
}));
|
|
36
|
-
it('should handle isCompact', () => {
|
|
37
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderSelectorDropdown_1.ChatbotHeaderSelectorDropdown, { value: "Option 1", isCompact: true, children: dropdownItems }));
|
|
38
|
-
expect(react_1.screen.getByRole('button', { name: /Select model/i })).toHaveClass('pf-m-compact');
|
|
39
|
-
});
|
|
40
|
-
it('should handle toggleProps', () => {
|
|
41
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderSelectorDropdown_1.ChatbotHeaderSelectorDropdown, { value: "Option 1", toggleProps: { isDisabled: true }, children: dropdownItems }));
|
|
42
|
-
expect(react_1.screen.getByRole('button', { name: /Select model/i })).toBeDisabled();
|
|
43
|
-
});
|
|
44
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,55 +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
|
-
const Chatbot_1 = require("../Chatbot/Chatbot");
|
|
9
|
-
const ChatbotHeaderTitle_1 = __importDefault(require("./ChatbotHeaderTitle"));
|
|
10
|
-
describe('ChatbotHeaderTitle', () => {
|
|
11
|
-
it('should render ChatbotHeaderTitle with children', () => {
|
|
12
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderTitle_1.default, { children: "Chatbot Header Title" }));
|
|
13
|
-
expect(react_1.screen.getByText('Chatbot Header Title')).toBeTruthy();
|
|
14
|
-
});
|
|
15
|
-
it('should render ChatbotHeaderTitle with custom classname', () => {
|
|
16
|
-
const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderTitle_1.default, { className: "custom-header-class", children: "Chatbot Header Title" }));
|
|
17
|
-
expect(container.querySelector('.custom-header-class')).toBeTruthy();
|
|
18
|
-
});
|
|
19
|
-
it('should render title for default display mode', () => {
|
|
20
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderTitle_1.default, { displayMode: Chatbot_1.ChatbotDisplayMode.default, showOnDefault: "Default header title" }));
|
|
21
|
-
expect(react_1.screen.getByText('Default header title')).toBeTruthy();
|
|
22
|
-
});
|
|
23
|
-
it('should render title for docked display mode', () => {
|
|
24
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderTitle_1.default, { displayMode: Chatbot_1.ChatbotDisplayMode.docked, showOnDocked: "Docked header title" }));
|
|
25
|
-
expect(react_1.screen.getByText('Docked header title')).toBeTruthy();
|
|
26
|
-
});
|
|
27
|
-
it('should fallback to default title when docked display mode title is not configured', () => {
|
|
28
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderTitle_1.default, { displayMode: Chatbot_1.ChatbotDisplayMode.docked, showOnDefault: "Default header title" }));
|
|
29
|
-
expect(react_1.screen.getByText('Default header title')).toBeTruthy();
|
|
30
|
-
});
|
|
31
|
-
it('should render title for embedded display mode', () => {
|
|
32
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderTitle_1.default, { displayMode: Chatbot_1.ChatbotDisplayMode.embedded, showOnEmbedded: "Embedded header title" }));
|
|
33
|
-
expect(react_1.screen.getByText('Embedded header title')).toBeTruthy();
|
|
34
|
-
});
|
|
35
|
-
it('should fallback to default title when embedded display mode title is not configured', () => {
|
|
36
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderTitle_1.default, { displayMode: Chatbot_1.ChatbotDisplayMode.embedded, showOnDefault: "Default header title" }));
|
|
37
|
-
expect(react_1.screen.getByText('Default header title')).toBeTruthy();
|
|
38
|
-
});
|
|
39
|
-
it('should render title for fullscreen display mode', () => {
|
|
40
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderTitle_1.default, { displayMode: Chatbot_1.ChatbotDisplayMode.fullscreen, showOnFullScreen: "Fullscreen header title", className: "custom-header-class" }));
|
|
41
|
-
expect(react_1.screen.getByText('Fullscreen header title')).toBeTruthy();
|
|
42
|
-
});
|
|
43
|
-
it('should fallback to default title when fullscreen display mode title is not configured', () => {
|
|
44
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderTitle_1.default, { displayMode: Chatbot_1.ChatbotDisplayMode.fullscreen, showOnDefault: "Default header title" }));
|
|
45
|
-
expect(react_1.screen.getByText('Default header title')).toBeTruthy();
|
|
46
|
-
});
|
|
47
|
-
it('should render title for drawer display mode', () => {
|
|
48
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderTitle_1.default, { displayMode: Chatbot_1.ChatbotDisplayMode.drawer, showOnDrawer: "Drawer header title", className: "custom-header-class" }));
|
|
49
|
-
expect(react_1.screen.getByText('Drawer header title')).toBeTruthy();
|
|
50
|
-
});
|
|
51
|
-
it('should fallback to default title when drawer display mode title is not configured', () => {
|
|
52
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotHeaderTitle_1.default, { displayMode: Chatbot_1.ChatbotDisplayMode.drawer, showOnDefault: "Default header title" }));
|
|
53
|
-
expect(react_1.screen.getByText('Default header title')).toBeTruthy();
|
|
54
|
-
});
|
|
55
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
@@ -1,16 +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
|
-
const ChatbotModal_1 = __importDefault(require("./ChatbotModal"));
|
|
9
|
-
require("@testing-library/jest-dom");
|
|
10
|
-
const react_core_1 = require("@patternfly/react-core");
|
|
11
|
-
describe('ChatbotModal', () => {
|
|
12
|
-
it('should render compact modal', () => {
|
|
13
|
-
(0, react_1.render)((0, jsx_runtime_1.jsxs)(ChatbotModal_1.default, { "data-testid": "modal", isCompact: true, isOpen: true, children: [(0, jsx_runtime_1.jsx)(react_core_1.ModalHeader, { title: "Modal with description", labelId: "modal-with-description-title", description: "A description is used when you want to provide more info about the modal than the title is able to describe. The content in the description is static and will not scroll with the rest of the modal body." }), (0, jsx_runtime_1.jsxs)(react_core_1.ModalBody, { tabIndex: 0, id: "modal-box-body-with-description", children: ["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Semper auctor neque vitae tempus. Diam donec adipiscing tristique risus. Augue eget arcu dictum varius duis. Ut enim blandit volutpat maecenas volutpat blandit aliquam. Sit amet mauris commodo quis imperdiet massa tincidunt. Habitant morbi tristique senectus et netus. Fames ac turpis egestas sed tempus urna. Neque laoreet suspendisse interdum consectetur libero id. Volutpat lacus laoreet non curabitur gravida arcu ac tortor. Porta nibh venenatis cras sed felis eget velit. Nullam non nisi est sit amet facilisis. Nunc mi ipsum faucibus vitae. Lorem sed risus ultricies tristique nulla aliquet enim tortor at. Egestas sed tempus urna et pharetra pharetra massa massa ultricies. Lacinia quis vel eros donec ac odio tempor orci. Malesuada fames ac turpis egestas integer eget aliquet.", (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("br", {}), "Neque aliquam vestibulum morbi blandit cursus risus at ultrices. Molestie at elementum eu facilisis sed odio morbi. Elit pellentesque habitant morbi tristique. Consequat nisl vel pretium lectus quam id leo in vitae. Quis varius quam quisque id diam vel quam elementum. Viverra nam libero justo laoreet sit amet cursus. Sollicitudin tempor id eu nisl nunc. Orci nulla pellentesque dignissim enim sit amet venenatis. Dignissim enim sit amet venenatis urna cursus eget. Iaculis at erat pellentesque adipiscing commodo elit. Faucibus pulvinar elementum integer enim neque volutpat. Nullam vehicula ipsum a arcu cursus vitae congue mauris. Nunc mattis enim ut tellus elementum sagittis vitae. Blandit cursus risus at ultrices. Tellus mauris a diam maecenas sed enim. Non diam phasellus vestibulum lorem sed risus ultricies tristique nulla.", (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("br", {}), "Nulla pharetra diam sit amet nisl suscipit adipiscing. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Sed felis eget velit aliquet sagittis id consectetur purus. Tincidunt tortor aliquam nulla facilisi cras fermentum. Volutpat est velit egestas dui id ornare arcu odio. Pharetra magna ac placerat vestibulum. Ultrices sagittis orci a scelerisque purus semper eget duis at. Nisi est sit amet facilisis magna etiam tempor orci eu. Convallis tellus id interdum velit. Facilisis sed odio morbi quis commodo odio aenean sed.", (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("br", {}), "Eu scelerisque felis imperdiet proin fermentum leo vel orci porta. Facilisi etiam dignissim diam quis enim lobortis scelerisque fermentum. Eleifend donec pretium vulputate sapien nec sagittis aliquam malesuada. Magna etiam tempor orci eu lobortis elementum. Quis auctor elit sed vulputate mi sit. Eleifend quam adipiscing vitae proin sagittis nisl rhoncus mattis rhoncus. Erat velit scelerisque in dictum non. Sit amet nulla facilisi morbi tempus iaculis urna. Enim ut tellus elementum sagittis vitae et leo duis ut. Lectus arcu bibendum at varius vel pharetra vel turpis. Morbi tristique senectus et netus et. Eget aliquet nibh praesent tristique magna sit amet purus gravida. Nisl purus in mollis nunc sed id semper risus. Id neque aliquam vestibulum morbi. Mauris a diam maecenas sed enim ut sem. Egestas tellus rutrum tellus pellentesque."] })] }));
|
|
14
|
-
expect(react_1.screen.getByTestId('modal')).toHaveClass('pf-m-compact');
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
@@ -1,64 +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 ChatbotToggle_1 = __importDefault(require("./ChatbotToggle"));
|
|
20
|
-
describe('ChatbotToggle', () => {
|
|
21
|
-
it('should render tooltipLabel correctly', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotToggle_1.default, { tooltipLabel: "Tooltip" }));
|
|
23
|
-
yield user_event_1.default.click(react_1.screen.getByRole('button', { name: /Tooltip toggle/i }));
|
|
24
|
-
expect(react_1.screen.getByRole('tooltip', { name: /Tooltip/i })).toBeTruthy();
|
|
25
|
-
}));
|
|
26
|
-
it('should render toggleButtonLabel correctly', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotToggle_1.default, { tooltipLabel: "Chatbot", toggleButtonLabel: "Button" }));
|
|
28
|
-
expect(react_1.screen.getByRole('button', { name: /Button/i })).toBeTruthy();
|
|
29
|
-
}));
|
|
30
|
-
it('should call onToggleChatbot when clicked', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
-
const spy = jest.fn();
|
|
32
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotToggle_1.default, { tooltipLabel: "Chatbot", onToggleChatbot: spy }));
|
|
33
|
-
yield user_event_1.default.click(react_1.screen.getByRole('button'));
|
|
34
|
-
expect(spy).toHaveBeenCalledTimes(1);
|
|
35
|
-
}));
|
|
36
|
-
it('should handle isChatbotVisible correctly when true', () => {
|
|
37
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotToggle_1.default, { tooltipLabel: "Chatbot", isChatbotVisible: true, openIconTestId: "Open" }));
|
|
38
|
-
expect(react_1.screen.getByRole('button')).toHaveClass('pf-chatbot__button');
|
|
39
|
-
expect(react_1.screen.getByRole('button')).toHaveClass('pf-chatbot__button--active');
|
|
40
|
-
expect(react_1.screen.getByRole('button')).toHaveAttribute('aria-expanded', 'true');
|
|
41
|
-
expect(react_1.screen.getByTestId('Open')).toBeTruthy();
|
|
42
|
-
});
|
|
43
|
-
it('should handle isChatbotVisible correctly when false', () => {
|
|
44
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotToggle_1.default, { tooltipLabel: "Chatbot", isChatbotVisible: false, openIconTestId: "Open" }));
|
|
45
|
-
expect(react_1.screen.getByRole('button')).toHaveClass('pf-chatbot__button');
|
|
46
|
-
expect(react_1.screen.getByRole('button')).not.toHaveClass('pf-chatbot__button--active');
|
|
47
|
-
expect(react_1.screen.getByRole('button')).toHaveAttribute('aria-expanded', 'false');
|
|
48
|
-
expect(react_1.screen.queryByTestId('Open')).toBeFalsy();
|
|
49
|
-
});
|
|
50
|
-
it('should handle isRound correctly', () => {
|
|
51
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotToggle_1.default, { tooltipLabel: "Chatbot", isRound: true }));
|
|
52
|
-
expect(react_1.screen.getByRole('button')).toHaveClass('pf-chatbot__button');
|
|
53
|
-
expect(react_1.screen.getByRole('button')).toHaveClass('pf-chatbot__button--round');
|
|
54
|
-
});
|
|
55
|
-
it('should handle className correctly', () => {
|
|
56
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotToggle_1.default, { tooltipLabel: "Chatbot", className: "test" }));
|
|
57
|
-
expect(react_1.screen.getByRole('button')).toHaveClass('pf-chatbot__button');
|
|
58
|
-
expect(react_1.screen.getByRole('button')).toHaveClass('test');
|
|
59
|
-
});
|
|
60
|
-
it('should handle colorVariant secondary correctly', () => {
|
|
61
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotToggle_1.default, { tooltipLabel: "Chatbot", colorVariant: "secondary" }));
|
|
62
|
-
expect(react_1.screen.getByRole('button')).toHaveClass('pf-chatbot__button--secondary');
|
|
63
|
-
});
|
|
64
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
@@ -1,61 +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 ChatbotWelcomePrompt_1 = __importDefault(require("./ChatbotWelcomePrompt"));
|
|
19
|
-
const user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
20
|
-
describe('ChatbotWelcomePrompt', () => {
|
|
21
|
-
it('should render welcome prompt', () => {
|
|
22
|
-
const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotWelcomePrompt_1.default, { title: "Hi, ChatBot User!", description: "How can I help you today?" }));
|
|
23
|
-
expect(container).toMatchSnapshot();
|
|
24
|
-
});
|
|
25
|
-
it('should render correctly', () => {
|
|
26
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotWelcomePrompt_1.default, { title: "Hi, ChatBot User!", description: "How can I help you today?" }));
|
|
27
|
-
expect(react_1.screen.getByText('Hi, ChatBot User!')).toBeTruthy();
|
|
28
|
-
expect(react_1.screen.getByText('How can I help you today?')).toBeTruthy();
|
|
29
|
-
});
|
|
30
|
-
it('should render prompts with titles correctly', () => {
|
|
31
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotWelcomePrompt_1.default, { title: "Hi, ChatBot User!", description: "How can I help you today?", prompts: [{ title: 'Set up account' }] }));
|
|
32
|
-
expect(react_1.screen.getByText('Set up account')).toBeTruthy();
|
|
33
|
-
});
|
|
34
|
-
it('should render prompts with messages correctly', () => {
|
|
35
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotWelcomePrompt_1.default, { title: "Hi, ChatBot User!", description: "How can I help you today?", prompts: [
|
|
36
|
-
{ title: 'Set up account', message: 'Choose the necessary settings and preferences for your account.' }
|
|
37
|
-
] }));
|
|
38
|
-
expect(react_1.screen.getByText('Choose the necessary settings and preferences for your account.')).toBeTruthy();
|
|
39
|
-
});
|
|
40
|
-
it('should render prompts with onClick correctly', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
-
const spy = jest.fn();
|
|
42
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotWelcomePrompt_1.default, { title: "Hi, ChatBot User!", description: "How can I help you today?", prompts: [
|
|
43
|
-
{
|
|
44
|
-
title: 'Set up account',
|
|
45
|
-
message: 'Choose the necessary settings and preferences for your account.',
|
|
46
|
-
onClick: spy
|
|
47
|
-
}
|
|
48
|
-
] }));
|
|
49
|
-
yield user_event_1.default.click(react_1.screen.getByRole('button', { name: /Set up account/i }));
|
|
50
|
-
expect(spy).toHaveBeenCalled();
|
|
51
|
-
}));
|
|
52
|
-
it('should apply className appropriately', () => {
|
|
53
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotWelcomePrompt_1.default, { title: "Hi, ChatBot User!", description: "How can I help you today?", className: "test", testId: "welcome-prompt" }));
|
|
54
|
-
const element = react_1.screen.getByTestId('welcome-prompt');
|
|
55
|
-
expect(element).toHaveClass('test');
|
|
56
|
-
});
|
|
57
|
-
it('should handle isCompact', () => {
|
|
58
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotWelcomePrompt_1.default, { title: "Hi, ChatBot User!", description: "How can I help you today?", className: "test", testId: "welcome-prompt", isCompact: true }));
|
|
59
|
-
expect(react_1.screen.getByTestId('welcome-prompt')).toHaveClass('pf-m-compact');
|
|
60
|
-
});
|
|
61
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
@@ -1,34 +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 CodeModal_1 = __importDefault(require("./CodeModal"));
|
|
19
|
-
describe('ChatbotModal', () => {
|
|
20
|
-
it('should render compact modal', () => {
|
|
21
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(CodeModal_1.default, { isCompact: true, code: "Hello world", fileName: "greetings.txt", isModalOpen: true, handleModalToggle: jest.fn(), onPrimaryAction: jest.fn(), onSecondaryAction: jest.fn(), title: "Preview attachment", primaryActionBtn: "Submit", secondaryActionBtn: "Cancel" }));
|
|
22
|
-
expect(react_1.screen.getByRole('dialog')).toHaveClass('pf-m-compact');
|
|
23
|
-
});
|
|
24
|
-
it('should render CodeModal with custom classNames', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(CodeModal_1.default, { isCompact: true, code: "Hello world", fileName: "greetings.txt", isModalOpen: true, handleModalToggle: jest.fn(), onPrimaryAction: jest.fn(), onSecondaryAction: jest.fn(), title: "Preview attachment", primaryActionBtn: "Submit", secondaryActionBtn: "Cancel", modalHeaderClassName: "custom-header-class", modalBodyClassName: "custom-body-class", modalFooterClassName: "custom-footer-class" }));
|
|
26
|
-
const modal = react_1.screen.getByRole('dialog');
|
|
27
|
-
const modalHeader = (0, react_1.within)(modal).getByRole('banner');
|
|
28
|
-
expect(modalHeader).toHaveClass('custom-header-class');
|
|
29
|
-
const modalBody = modal.querySelector('#code-modal-body');
|
|
30
|
-
expect(modalBody).toHaveClass('custom-body-class');
|
|
31
|
-
const modalfooter = (0, react_1.within)(modal).getByRole('contentinfo');
|
|
32
|
-
expect(modalfooter).toHaveClass('custom-footer-class');
|
|
33
|
-
}));
|
|
34
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
@@ -1,18 +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 Compare_1 = __importDefault(require("./Compare"));
|
|
10
|
-
const firstChild = ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("h1", { children: "Child 1" }) }));
|
|
11
|
-
const secondChild = ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("h1", { children: "Child 2" }) }));
|
|
12
|
-
describe('Compare', () => {
|
|
13
|
-
it('should render compare correctly', () => {
|
|
14
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(Compare_1.default, { firstChildDisplayName: "Child 1", secondChildDisplayName: "Child 2", firstChild: firstChild, secondChild: secondChild }));
|
|
15
|
-
expect(react_1.screen.getByRole('heading', { name: /Child 1/i })).toBeTruthy();
|
|
16
|
-
expect(react_1.screen.getByRole('heading', { name: /Child 2/i })).toBeTruthy();
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
@@ -1,146 +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
|
-
const user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
18
|
-
require("@testing-library/jest-dom");
|
|
19
|
-
const DeepThinking_1 = __importDefault(require("./DeepThinking"));
|
|
20
|
-
describe('DeepThinking', () => {
|
|
21
|
-
const defaultProps = {
|
|
22
|
-
toggleContent: 'Show thinking'
|
|
23
|
-
};
|
|
24
|
-
it('should render with required props only', () => {
|
|
25
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps)));
|
|
26
|
-
expect(react_1.screen.getByText('Show thinking')).toBeTruthy();
|
|
27
|
-
});
|
|
28
|
-
it('should render subheading when provided', () => {
|
|
29
|
-
const subheading = 'Thought for 3 seconds';
|
|
30
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { subheading: subheading })));
|
|
31
|
-
expect(react_1.screen.getByText(subheading)).toBeTruthy();
|
|
32
|
-
});
|
|
33
|
-
it('should render body content when provided', () => {
|
|
34
|
-
const body = "Here's why I think that";
|
|
35
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { body: body })));
|
|
36
|
-
expect(react_1.screen.getByText(body)).toBeTruthy();
|
|
37
|
-
});
|
|
38
|
-
it('should render with complex content including React elements', () => {
|
|
39
|
-
const body = ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("p", { children: "Complex body content" }), (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsx)("li", { children: "Item 1" }), (0, jsx_runtime_1.jsx)("li", { children: "Item 2" })] })] }));
|
|
40
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { body: body })));
|
|
41
|
-
expect(react_1.screen.getByText('Complex body content')).toBeTruthy();
|
|
42
|
-
expect(react_1.screen.getByText('Item 1')).toBeTruthy();
|
|
43
|
-
expect(react_1.screen.getByText('Item 2')).toBeTruthy();
|
|
44
|
-
});
|
|
45
|
-
it('should apply custom className from cardProps', () => {
|
|
46
|
-
const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { cardProps: { className: 'custom-tool-response-class' } })));
|
|
47
|
-
expect(container.querySelector('.custom-tool-response-class')).toBeTruthy();
|
|
48
|
-
});
|
|
49
|
-
it('should pass through expandableSectionProps', () => {
|
|
50
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { expandableSectionProps: { className: 'custom-expandable-class' } })));
|
|
51
|
-
expect(document.querySelector('.custom-expandable-class')).toBeTruthy();
|
|
52
|
-
});
|
|
53
|
-
it('should not render subheading span when subheading is not provided', () => {
|
|
54
|
-
const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps)));
|
|
55
|
-
const subheadingContainer = container.querySelector('.pf-chatbot__tool-response-subheading');
|
|
56
|
-
expect(subheadingContainer).toBeFalsy();
|
|
57
|
-
});
|
|
58
|
-
it('should pass through cardBodyProps', () => {
|
|
59
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { body: "Thinking content", cardBodyProps: { className: 'custom-card-body-class' } })));
|
|
60
|
-
const cardBody = react_1.screen.getByText('Thinking content').closest('.pf-v6-c-card__body');
|
|
61
|
-
expect(cardBody).toHaveClass('custom-card-body-class');
|
|
62
|
-
});
|
|
63
|
-
it('Renders expanded by default', () => {
|
|
64
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { body: "Thinking content" })));
|
|
65
|
-
expect(react_1.screen.getByRole('button', { name: defaultProps.toggleContent })).toHaveAttribute('aria-expanded', 'true');
|
|
66
|
-
expect(react_1.screen.getByText('Thinking content')).toBeVisible();
|
|
67
|
-
});
|
|
68
|
-
it('Renders collapsed when isDefaultExpanded is false', () => {
|
|
69
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({ isDefaultExpanded: false }, defaultProps, { body: "Thinking content" })));
|
|
70
|
-
expect(react_1.screen.getByRole('button', { name: defaultProps.toggleContent })).toHaveAttribute('aria-expanded', 'false');
|
|
71
|
-
expect(react_1.screen.getByText('Thinking content')).not.toBeVisible();
|
|
72
|
-
});
|
|
73
|
-
it('expandableSectionProps.isExpanded overrides isDefaultExpanded', () => {
|
|
74
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { isDefaultExpanded: false, body: "Thinking content", expandableSectionProps: { isExpanded: true } })));
|
|
75
|
-
expect(react_1.screen.getByRole('button', { name: defaultProps.toggleContent })).toHaveAttribute('aria-expanded', 'true');
|
|
76
|
-
expect(react_1.screen.getByText('Thinking content')).toBeVisible();
|
|
77
|
-
});
|
|
78
|
-
it('expandableSectionProps.onToggle overrides internal onToggle behavior', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
79
|
-
const user = user_event_1.default.setup();
|
|
80
|
-
const customOnToggle = jest.fn();
|
|
81
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { isDefaultExpanded: false, body: "Thinking content", expandableSectionProps: { onToggle: customOnToggle } })));
|
|
82
|
-
const toggleButton = react_1.screen.getByRole('button', { name: defaultProps.toggleContent });
|
|
83
|
-
expect(toggleButton).toHaveAttribute('aria-expanded', 'false');
|
|
84
|
-
yield user.click(toggleButton);
|
|
85
|
-
expect(customOnToggle).toHaveBeenCalled();
|
|
86
|
-
expect(toggleButton).toHaveAttribute('aria-expanded', 'false');
|
|
87
|
-
expect(react_1.screen.getByText('Thinking content')).not.toBeVisible();
|
|
88
|
-
}));
|
|
89
|
-
it('should render toggleContent as markdown when isToggleContentMarkdown is true', () => {
|
|
90
|
-
const toggleContent = '**Bold thinking**';
|
|
91
|
-
const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, { toggleContent: toggleContent, isToggleContentMarkdown: true }));
|
|
92
|
-
expect(container.querySelector('strong')).toBeTruthy();
|
|
93
|
-
expect(react_1.screen.getByText('Bold thinking')).toBeTruthy();
|
|
94
|
-
});
|
|
95
|
-
it('should not render toggleContent as markdown when isToggleContentMarkdown is false', () => {
|
|
96
|
-
const toggleContent = '**Bold thinking**';
|
|
97
|
-
const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, { toggleContent: toggleContent }));
|
|
98
|
-
expect(container.querySelector('strong')).toBeFalsy();
|
|
99
|
-
expect(react_1.screen.getByText('**Bold thinking**')).toBeTruthy();
|
|
100
|
-
});
|
|
101
|
-
it('should render subheading as markdown when isSubheadingMarkdown is true', () => {
|
|
102
|
-
const subheading = '**Bold subheading**';
|
|
103
|
-
const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { subheading: subheading, isSubheadingMarkdown: true })));
|
|
104
|
-
expect(container.querySelector('strong')).toBeTruthy();
|
|
105
|
-
expect(react_1.screen.getByText('Bold subheading')).toBeTruthy();
|
|
106
|
-
});
|
|
107
|
-
it('should not render subheading as markdown when isSubheadingMarkdown is false', () => {
|
|
108
|
-
const subheading = '**Bold subheading**';
|
|
109
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { subheading: subheading })));
|
|
110
|
-
expect(react_1.screen.getByText('**Bold subheading**')).toBeTruthy();
|
|
111
|
-
});
|
|
112
|
-
it('should render body as markdown when isBodyMarkdown is true', () => {
|
|
113
|
-
const body = '**Bold body**';
|
|
114
|
-
const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { body: body, isBodyMarkdown: true })));
|
|
115
|
-
expect(container.querySelector('strong')).toBeTruthy();
|
|
116
|
-
expect(react_1.screen.getByText('Bold body')).toBeTruthy();
|
|
117
|
-
});
|
|
118
|
-
it('should not render body as markdown when isBodyMarkdown is false', () => {
|
|
119
|
-
const body = '**Bold body**';
|
|
120
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { body: body })));
|
|
121
|
-
expect(react_1.screen.getByText('**Bold body**')).toBeTruthy();
|
|
122
|
-
});
|
|
123
|
-
it('should pass markdownContentProps to MarkdownContent component', () => {
|
|
124
|
-
const body = '**Bold body**';
|
|
125
|
-
const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { body: body, isBodyMarkdown: true, markdownContentProps: { isPrimary: true } })));
|
|
126
|
-
expect(container.querySelector('.pf-m-primary')).toBeTruthy();
|
|
127
|
-
});
|
|
128
|
-
it('should render spinner when isLoading is true', () => {
|
|
129
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { isLoading: true })));
|
|
130
|
-
expect(react_1.screen.getByLabelText('Contents')).toBeInTheDocument();
|
|
131
|
-
});
|
|
132
|
-
it('should not render spinner when isLoading is false', () => {
|
|
133
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps)));
|
|
134
|
-
expect(react_1.screen.queryByLabelText('Contents')).not.toBeInTheDocument();
|
|
135
|
-
});
|
|
136
|
-
it('should pass spinnerProps to Spinner component', () => {
|
|
137
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, Object.assign({}, defaultProps, { isLoading: true, spinnerProps: { 'aria-label': 'Custom label' } })));
|
|
138
|
-
expect(react_1.screen.getByLabelText('Custom label')).toBeInTheDocument();
|
|
139
|
-
});
|
|
140
|
-
it('should not render spinner when isToggleContentMarkdown is true', () => {
|
|
141
|
-
const toggleContent = '**Bold thinking**';
|
|
142
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(DeepThinking_1.default, { toggleContent: toggleContent, isToggleContentMarkdown: true, isLoading: true }));
|
|
143
|
-
expect(react_1.screen.queryByLabelText('Contents')).not.toBeInTheDocument();
|
|
144
|
-
expect(react_1.screen.getByText('Bold thinking')).toBeInTheDocument();
|
|
145
|
-
});
|
|
146
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
@@ -1,42 +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 FileDetails_1 = __importDefault(require("./FileDetails"));
|
|
10
|
-
describe('FileDetails', () => {
|
|
11
|
-
it('should render file details', () => {
|
|
12
|
-
const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(FileDetails_1.default, { fileName: "test.txt" }));
|
|
13
|
-
expect(container).toMatchSnapshot();
|
|
14
|
-
});
|
|
15
|
-
it('should render file details correctly if an extension we support is passed in', () => {
|
|
16
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(FileDetails_1.default, { fileName: "test.txt", languageTestId: "language" }));
|
|
17
|
-
expect(react_1.screen.getByText('test')).toBeTruthy();
|
|
18
|
-
expect(react_1.screen.queryByText('test.txt')).toBeFalsy();
|
|
19
|
-
expect(react_1.screen.getByText('TEXT')).toBeTruthy();
|
|
20
|
-
expect(react_1.screen.getByTestId('language')).toBeTruthy();
|
|
21
|
-
});
|
|
22
|
-
it('should skip language if we do not support an extension', () => {
|
|
23
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(FileDetails_1.default, { fileName: "test.joke", languageTestId: "language" }));
|
|
24
|
-
expect(react_1.screen.getByText('test')).toBeTruthy();
|
|
25
|
-
expect(react_1.screen.queryByTestId('language')).toBeFalsy();
|
|
26
|
-
});
|
|
27
|
-
it('should support image formats by rendering extension differently', () => {
|
|
28
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(FileDetails_1.default, { fileName: "test.svg", languageTestId: "language" }));
|
|
29
|
-
expect(react_1.screen.getByText('test')).toBeTruthy();
|
|
30
|
-
expect(react_1.screen.queryByText('test.svg')).toBeFalsy();
|
|
31
|
-
expect(react_1.screen.queryByTestId('language')).toBeFalsy();
|
|
32
|
-
});
|
|
33
|
-
it('should handle truncation differently', () => {
|
|
34
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(FileDetails_1.default, { fileName: "test.svg", languageTestId: "language", hasTruncation: false }));
|
|
35
|
-
expect(react_1.screen.getByText('test.svg')).toBeTruthy();
|
|
36
|
-
expect(react_1.screen.queryByTestId('language')).toBeFalsy();
|
|
37
|
-
});
|
|
38
|
-
it('should include file size if prop passed in', () => {
|
|
39
|
-
(0, react_1.render)((0, jsx_runtime_1.jsx)(FileDetails_1.default, { fileName: "test.joke", languageTestId: "language", fileSize: "100MB" }));
|
|
40
|
-
expect(react_1.screen.getByText('100MB')).toBeTruthy();
|
|
41
|
-
});
|
|
42
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|