@coveo/quantic 3.44.1 → 3.44.3
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/README.md +12 -3
- package/force-app/main/default/classes/OrganizationEndpointsTest.cls +71 -15
- package/force-app/main/default/classes/RecommendationsControllerTest.cls +1 -1
- package/force-app/main/default/lwc/quanticCitation/quanticCitation.js +2 -2
- package/force-app/main/default/lwc/quanticHeadlessLoader/quanticHeadlessLoader.js +158 -87
- package/force-app/main/default/lwc/quanticTabBar/quanticTabBar.js +148 -125
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +16 -16
- package/force-app/main/default/staticresources/coveoheadless/headless.js +17 -17
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +16 -16
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +16 -16
- package/force-app/main/default/staticresources/dompurify/purify.min.js +2 -2
- package/package.json +43 -41
- package/force-app/main/default/lwc/quanticAriaLive/__tests__/quanticAriaLive.test.js +0 -106
- package/force-app/main/default/lwc/quanticBreadcrumbManager/__tests__/quanticBreadcrumbManager.test.js +0 -752
- package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/data.ts +0 -130
- package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/fixture.ts +0 -87
- package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/pageObject.ts +0 -282
- package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/quanticBreadcrumbManager.e2e.ts +0 -208
- package/force-app/main/default/lwc/quanticCarousel/__tests__/quanticCarousel.test.js +0 -262
- package/force-app/main/default/lwc/quanticCaseClassification/__tests__/quanticCaseClassification.test.js +0 -819
- package/force-app/main/default/lwc/quanticCaseClassification/e2e/data.ts +0 -23
- package/force-app/main/default/lwc/quanticCaseClassification/e2e/fixture.ts +0 -51
- package/force-app/main/default/lwc/quanticCaseClassification/e2e/pageObject.ts +0 -152
- package/force-app/main/default/lwc/quanticCaseClassification/e2e/quanticCaseClassification.e2e.ts +0 -269
- package/force-app/main/default/lwc/quanticCategoryFacet/__tests__/quanticCategoryFacet.test.js +0 -1183
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/data.ts +0 -91
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/fixture.ts +0 -79
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/pageObject.ts +0 -55
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/quanticCategoryFacet.e2e.ts +0 -219
- package/force-app/main/default/lwc/quanticCitation/__tests__/quanticCitation.test.js +0 -581
- package/force-app/main/default/lwc/quanticColoredResultBadge/__tests__/quanticColoredResultBadge.test.js +0 -212
- package/force-app/main/default/lwc/quanticDateFacet/__tests__/quanticDateFacet.test.js +0 -688
- package/force-app/main/default/lwc/quanticDateFacet/e2e/data.ts +0 -44
- package/force-app/main/default/lwc/quanticDateFacet/e2e/fixture.ts +0 -72
- package/force-app/main/default/lwc/quanticDateFacet/e2e/pageObject.ts +0 -27
- package/force-app/main/default/lwc/quanticDateFacet/e2e/quanticDateFacet.e2e.ts +0 -167
- package/force-app/main/default/lwc/quanticDidYouMean/__tests__/quanticDidYouMean.test.js +0 -348
- package/force-app/main/default/lwc/quanticDidYouMean/e2e/data.ts +0 -48
- package/force-app/main/default/lwc/quanticDidYouMean/e2e/fixture.ts +0 -84
- package/force-app/main/default/lwc/quanticDidYouMean/e2e/pageObject.ts +0 -173
- package/force-app/main/default/lwc/quanticDidYouMean/e2e/quanticDidYouMean.e2e.ts +0 -219
- package/force-app/main/default/lwc/quanticDocumentSuggestion/__tests__/quanticDocumentSuggestion.test.js +0 -404
- package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/fixture.ts +0 -38
- package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/pageObject.ts +0 -52
- package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/quanticDocumentSuggestion.e2e.ts +0 -102
- package/force-app/main/default/lwc/quanticFacet/__tests__/quanticFacet.test.js +0 -1105
- package/force-app/main/default/lwc/quanticFacet/e2e/data.ts +0 -62
- package/force-app/main/default/lwc/quanticFacet/e2e/fixture.ts +0 -78
- package/force-app/main/default/lwc/quanticFacet/e2e/pageObject.ts +0 -67
- package/force-app/main/default/lwc/quanticFacet/e2e/quanticFacet.e2e.ts +0 -242
- package/force-app/main/default/lwc/quanticFacetCaption/__tests__/quanticFacetCaption.test.js +0 -28
- package/force-app/main/default/lwc/quanticFacetManager/__tests__/quanticFacetManager.test.js +0 -178
- package/force-app/main/default/lwc/quanticFacetManager/e2e/data.ts +0 -59
- package/force-app/main/default/lwc/quanticFacetManager/e2e/fixture.ts +0 -75
- package/force-app/main/default/lwc/quanticFacetManager/e2e/pageObject.ts +0 -23
- package/force-app/main/default/lwc/quanticFacetManager/e2e/quanticFacetManager.e2e.ts +0 -82
- package/force-app/main/default/lwc/quanticFeedback/__tests__/quanticFeedback.test.js +0 -403
- package/force-app/main/default/lwc/quanticFeedbackModal/__tests__/quanticFeedbackModal.test.js +0 -448
- package/force-app/main/default/lwc/quanticFeedbackModalQna/__tests__/quanticFeedbackModalQna.test.js +0 -298
- package/force-app/main/default/lwc/quanticFoldedResultList/__tests__/quanticFoldedResultList.test.js +0 -323
- package/force-app/main/default/lwc/quanticFoldedResultList/e2e/fixture.ts +0 -74
- package/force-app/main/default/lwc/quanticFoldedResultList/e2e/pageObject.ts +0 -81
- package/force-app/main/default/lwc/quanticFoldedResultList/e2e/quanticFoldedResultList.e2e.ts +0 -69
- package/force-app/main/default/lwc/quanticGeneratedAnswer/__tests__/quanticGeneratedAnswer.test.js +0 -1575
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/agentData.ts +0 -279
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/data.ts +0 -56
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/fixture-agent.ts +0 -77
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/fixture.ts +0 -194
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/pageObject.ts +0 -599
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/quanticGeneratedAnswer.e2e.ts +0 -333
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/quanticGeneratedAnswerAgent.e2e.ts +0 -298
- package/force-app/main/default/lwc/quanticGeneratedAnswerBody/__tests__/quanticGeneratedAnswerBody.test.js +0 -418
- package/force-app/main/default/lwc/quanticGeneratedAnswerContent/__tests__/quanticGeneratedAnswerContent.test.js +0 -447
- package/force-app/main/default/lwc/quanticGeneratedAnswerCopyToClipboard/__tests__/quanticGeneratedAnswerCopyToClipboard.test.js +0 -129
- package/force-app/main/default/lwc/quanticGeneratedAnswerFollowUpInput/__tests__/quanticGeneratedAnswerFollowUpInput.test.js +0 -466
- package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/__tests__/quanticGeneratedAnswerStreamOfThought.test.js +0 -402
- package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/__tests__/stepsUtils.test.js +0 -118
- package/force-app/main/default/lwc/quanticGeneratedAnswerThread/__tests__/quanticGeneratedAnswerThread.test.js +0 -285
- package/force-app/main/default/lwc/quanticHeading/__tests__/quanticHeading.test.js +0 -71
- package/force-app/main/default/lwc/quanticHeadlessLoader/__tests__/quanticHeadlessLoader.test.js +0 -651
- package/force-app/main/default/lwc/quanticInsightInterface/__tests__/quanticInsightInterface.test.js +0 -194
- package/force-app/main/default/lwc/quanticInsightSummary/__tests__/quanticInsightSummary.test.js +0 -230
- package/force-app/main/default/lwc/quanticModal/__tests__/quanticModal.test.js +0 -205
- package/force-app/main/default/lwc/quanticNotifications/__tests__/quanticNotifications.test.js +0 -309
- package/force-app/main/default/lwc/quanticNotifications/e2e/fixture.ts +0 -62
- package/force-app/main/default/lwc/quanticNotifications/e2e/pageObject.ts +0 -55
- package/force-app/main/default/lwc/quanticNotifications/e2e/quanticNotifications.e2e.ts +0 -47
- package/force-app/main/default/lwc/quanticNumericFacet/__tests__/quanticNumericFacet.test.js +0 -953
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/data.ts +0 -48
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/fixture.ts +0 -75
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/pageObject.ts +0 -59
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/quanticNumericFacet.e2e.ts +0 -186
- package/force-app/main/default/lwc/quanticPager/__tests__/quanticPager.test.js +0 -430
- package/force-app/main/default/lwc/quanticPager/e2e/fixture.ts +0 -65
- package/force-app/main/default/lwc/quanticPager/e2e/pageObject.ts +0 -69
- package/force-app/main/default/lwc/quanticPager/e2e/quanticPager.e2e.ts +0 -106
- package/force-app/main/default/lwc/quanticPlaceholder/__tests__/quanticPlaceholder.test.js +0 -47
- package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/data/defaultTestCase.json +0 -13
- package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/data/youtubeTestCase.json +0 -14
- package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/quanticQuickviewContent.test.js +0 -82
- package/force-app/main/default/lwc/quanticRadioButtonsGroup/__tests__/quanticRadioButtonsGroup.test.js +0 -273
- package/force-app/main/default/lwc/quanticRecentQueriesList/__tests__/quanticRecentQueriesList.test.js +0 -448
- package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/fixture.ts +0 -43
- package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/pageObject.ts +0 -55
- package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/quanticRecentQueriesList.e2e.ts +0 -93
- package/force-app/main/default/lwc/quanticRecentResultsList/__tests__/quanticRecentResultsList.test.js +0 -516
- package/force-app/main/default/lwc/quanticRecentResultsList/e2e/fixture.ts +0 -43
- package/force-app/main/default/lwc/quanticRecentResultsList/e2e/pageObject.ts +0 -61
- package/force-app/main/default/lwc/quanticRecentResultsList/e2e/quanticRecentResultsList.e2e.ts +0 -48
- package/force-app/main/default/lwc/quanticRecommendationList/__tests__/quanticRecommendationList.test.js +0 -491
- package/force-app/main/default/lwc/quanticRecommendationList/e2e/fixture.ts +0 -36
- package/force-app/main/default/lwc/quanticRecommendationList/e2e/pageObject.ts +0 -52
- package/force-app/main/default/lwc/quanticRecommendationList/e2e/quanticRecommendationList.e2e.ts +0 -53
- package/force-app/main/default/lwc/quanticRefineModalContent/__tests__/quanticRefineModalContent.test.js +0 -747
- package/force-app/main/default/lwc/quanticRefineToggle/__tests__/quanticRefineToggle.test.js +0 -544
- package/force-app/main/default/lwc/quanticResultAction/__tests__/quanticResultAction.test.js +0 -262
- package/force-app/main/default/lwc/quanticResultActionBar/__tests__/quanticResultActionBar.test.js +0 -141
- package/force-app/main/default/lwc/quanticResultChildren/__tests__/quanticResultChildren.test.js +0 -340
- package/force-app/main/default/lwc/quanticResultCopyToClipboard/__tests__/quanticResultCopyToClipboard.test.js +0 -300
- package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/fixture.ts +0 -49
- package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/pageObject.ts +0 -49
- package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/quanticResultCopyToClipboard.e2e.ts +0 -40
- package/force-app/main/default/lwc/quanticResultDate/__tests__/quanticResultDate.test.js +0 -144
- package/force-app/main/default/lwc/quanticResultField/__tests__/quanticResultField.test.js +0 -120
- package/force-app/main/default/lwc/quanticResultHighlightedTextField/__tests__/quanticResultHighlightedTextField.test.js +0 -209
- package/force-app/main/default/lwc/quanticResultLink/__tests__/quanticResultLink.test.js +0 -302
- package/force-app/main/default/lwc/quanticResultList/__tests__/quanticResultList.test.js +0 -342
- package/force-app/main/default/lwc/quanticResultList/e2e/fixture.ts +0 -70
- package/force-app/main/default/lwc/quanticResultList/e2e/pageObject.ts +0 -81
- package/force-app/main/default/lwc/quanticResultList/e2e/quanticResultList.e2e.ts +0 -69
- package/force-app/main/default/lwc/quanticResultMultiValueText/__tests__/quanticResultMultiValueText.test.js +0 -235
- package/force-app/main/default/lwc/quanticResultNumber/__tests__/quanticResultNumber.test.js +0 -144
- package/force-app/main/default/lwc/quanticResultPrintableUri/__tests__/quanticResultPrintableUri.test.js +0 -324
- package/force-app/main/default/lwc/quanticResultQuickview/__tests__/quanticResultQuickview.test.js +0 -308
- package/force-app/main/default/lwc/quanticResultQuickview/e2e/fixture.ts +0 -85
- package/force-app/main/default/lwc/quanticResultQuickview/e2e/pageObject.ts +0 -38
- package/force-app/main/default/lwc/quanticResultQuickview/e2e/quanticResultQuickView.e2e.ts +0 -66
- package/force-app/main/default/lwc/quanticResultTemplate/__tests__/quanticResultTemplate.test.js +0 -90
- package/force-app/main/default/lwc/quanticResultText/__tests__/quanticResultText.test.js +0 -155
- package/force-app/main/default/lwc/quanticResultsPerPage/__tests__/quanticResultsPerPage.test.js +0 -464
- package/force-app/main/default/lwc/quanticResultsPerPage/e2e/fixture.ts +0 -78
- package/force-app/main/default/lwc/quanticResultsPerPage/e2e/pageObject.ts +0 -85
- package/force-app/main/default/lwc/quanticResultsPerPage/e2e/quanticResultsPerPage.e2e.ts +0 -97
- package/force-app/main/default/lwc/quanticSearchBox/__tests__/quanticSearchBox.test.js +0 -487
- package/force-app/main/default/lwc/quanticSearchBox/e2e/fixture.ts +0 -86
- package/force-app/main/default/lwc/quanticSearchBox/e2e/pageObject.ts +0 -45
- package/force-app/main/default/lwc/quanticSearchBox/e2e/quanticSearchBox.e2e.ts +0 -159
- package/force-app/main/default/lwc/quanticSearchBoxInput/__tests__/quanticSearchBoxInput.test.js +0 -743
- package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/__tests__/quanticSearchBoxSuggestionsList.test.js +0 -571
- package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/fixture.ts +0 -113
- package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/pageObject.ts +0 -113
- package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/quanticSearchBoxSuggestionsList.e2e.ts +0 -282
- package/force-app/main/default/lwc/quanticSmartSnippet/__tests__/quanticSmartSnippet.test.js +0 -341
- package/force-app/main/default/lwc/quanticSmartSnippet/e2e/data.ts +0 -21
- package/force-app/main/default/lwc/quanticSmartSnippet/e2e/fixture.ts +0 -93
- package/force-app/main/default/lwc/quanticSmartSnippet/e2e/pageObject.ts +0 -196
- package/force-app/main/default/lwc/quanticSmartSnippet/e2e/quanticSmartSnippet.e2e.ts +0 -168
- package/force-app/main/default/lwc/quanticSmartSnippetAnswer/__tests__/quanticSmartSnippetAnswer.test.js +0 -126
- package/force-app/main/default/lwc/quanticSmartSnippetSource/__tests__/quanticSmartSnippetSource.test.js +0 -290
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/__tests__/quanticSmartSnippetSuggestions.test.js +0 -329
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/data.ts +0 -31
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/fixture.ts +0 -95
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/pageObject.ts +0 -160
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/quanticSmartSnippetSuggestions.e2e.ts +0 -127
- package/force-app/main/default/lwc/quanticSort/__tests__/quanticSort.test.js +0 -416
- package/force-app/main/default/lwc/quanticSort/e2e/fixture.ts +0 -62
- package/force-app/main/default/lwc/quanticSort/e2e/pageObject.ts +0 -100
- package/force-app/main/default/lwc/quanticSort/e2e/quanticSort.e2e.ts +0 -86
- package/force-app/main/default/lwc/quanticSourceCitations/__tests__/quanticSourceCitations.test.js +0 -156
- package/force-app/main/default/lwc/quanticStandaloneSearchBox/__tests__/quanticStandaloneSearchBox.test.js +0 -387
- package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/fixture.ts +0 -54
- package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/pageObject.ts +0 -54
- package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/quanticStandaloneSearchBox.e2e.ts +0 -72
- package/force-app/main/default/lwc/quanticStatefulButton/__tests__/quanticStatefulButton.test.js +0 -222
- package/force-app/main/default/lwc/quanticSummary/__tests__/quanticSummary.test.js +0 -244
- package/force-app/main/default/lwc/quanticTab/__tests__/quanticTab.test.js +0 -333
- package/force-app/main/default/lwc/quanticTab/e2e/fixture.ts +0 -60
- package/force-app/main/default/lwc/quanticTab/e2e/pageObject.ts +0 -68
- package/force-app/main/default/lwc/quanticTab/e2e/quanticTab.e2e.ts +0 -72
- package/force-app/main/default/lwc/quanticTabBar/__tests__/quanticTabBar.test.js +0 -331
- package/force-app/main/default/lwc/quanticTabBar/e2e/fixture.ts +0 -65
- package/force-app/main/default/lwc/quanticTabBar/e2e/pageObject.ts +0 -80
- package/force-app/main/default/lwc/quanticTabBar/e2e/quanticTabBar.e2e.ts +0 -172
- package/force-app/main/default/lwc/quanticThreadItem/__tests__/quanticThreadItem.test.js +0 -314
- package/force-app/main/default/lwc/quanticTimeframeFacet/__tests__/quanticTimeframeFacet.test.js +0 -1059
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/data.ts +0 -66
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/fixture.ts +0 -74
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/pageObject.ts +0 -43
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/quanticTimeframeFacet.e2e.ts +0 -184
- package/force-app/main/default/lwc/quanticTooltip/__tests__/quanticTooltip.test.js +0 -107
- package/force-app/main/default/lwc/quanticUserAction/__tests__/quanticUserAction.test.js +0 -427
- package/force-app/main/default/lwc/quanticUserActionsSession/__tests__/quanticUserActionsSession.test.js +0 -269
- package/force-app/main/default/lwc/quanticUserActionsTimeline/__tests__/data/userActionsState.json +0 -89
- package/force-app/main/default/lwc/quanticUserActionsTimeline/__tests__/quanticUserActionsTimeline.test.js +0 -511
- package/force-app/main/default/lwc/quanticUserActionsToggle/__tests__/quanticUserActionsToggle.test.js +0 -229
- package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/data.ts +0 -32
- package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/fixture.ts +0 -32
- package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/pageObject.ts +0 -71
- package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/quanticUserActionsToggle.e2e.ts +0 -39
- package/force-app/main/default/lwc/quanticUtils/__tests__/accessibilityUtils.test.js +0 -214
- package/force-app/main/default/lwc/quanticUtils/__tests__/citationAnchoringUtils.test.js +0 -84
- package/force-app/main/default/lwc/quanticUtils/__tests__/facetDependenciesUtils.test.js +0 -92
- package/force-app/main/default/lwc/quanticUtils/__tests__/facetStoreUtils.test.js +0 -86
- package/force-app/main/default/lwc/quanticUtils/__tests__/markdownUtils.test.js +0 -109
- package/force-app/main/default/lwc/quanticUtils/__tests__/quanticUtils.test.js +0 -233
- package/force-app/main/default/lwc/quanticUtils/__tests__/timeAndDateUtils.test.js +0 -22
- package/force-app/main/default/lwc/quanticViewedByCustomerBadge/__tests__/quanticViewedByCustomerBadge.test.js +0 -131
package/force-app/main/default/lwc/quanticRefineToggle/__tests__/quanticRefineToggle.test.js
DELETED
|
@@ -1,544 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-import-assign */
|
|
2
|
-
// @ts-ignore
|
|
3
|
-
import QuanticRefineToggle from 'c/quanticRefineToggle';
|
|
4
|
-
import * as mockHeadlessLoader from 'c/quanticHeadlessLoader';
|
|
5
|
-
import {cleanup, buildCreateTestComponent, flushPromises} from 'c/testUtils';
|
|
6
|
-
|
|
7
|
-
jest.mock('c/quanticHeadlessLoader');
|
|
8
|
-
jest.mock('c/quanticUtils', () => ({
|
|
9
|
-
AriaLiveRegion: jest.fn(() => ({
|
|
10
|
-
dispatchMessage: jest.fn(),
|
|
11
|
-
})),
|
|
12
|
-
loadMarkdownDependencies: jest.fn(
|
|
13
|
-
() =>
|
|
14
|
-
new Promise((resolve) => {
|
|
15
|
-
resolve();
|
|
16
|
-
})
|
|
17
|
-
),
|
|
18
|
-
I18nUtils: {
|
|
19
|
-
format: jest.fn(),
|
|
20
|
-
},
|
|
21
|
-
getFirstFocusableElement: jest.fn(),
|
|
22
|
-
getLastFocusableElement: jest.fn(),
|
|
23
|
-
}));
|
|
24
|
-
|
|
25
|
-
/** @type {Object} */
|
|
26
|
-
const defaultOptions = {
|
|
27
|
-
fieldsToIncludeInCitations: 'sfid,sfkbid,sfkavid',
|
|
28
|
-
answerConfigurationId: undefined,
|
|
29
|
-
withToggle: false,
|
|
30
|
-
collapsible: false,
|
|
31
|
-
maxCollapsedHeight: 250,
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const createTestComponent = buildCreateTestComponent(
|
|
35
|
-
QuanticRefineToggle,
|
|
36
|
-
'c-quantic-refine-toggle',
|
|
37
|
-
defaultOptions
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
const selectors = {
|
|
41
|
-
initializationError: 'c-quantic-component-error',
|
|
42
|
-
refineToggleButton: '[data-testid="refine-toggle__button"]',
|
|
43
|
-
modal: '[data-testid="refine-toggle__modal"]',
|
|
44
|
-
modalCloseButton: '[data-testid="refine-toggle__modal-close-button"]',
|
|
45
|
-
modalViewResultsButton:
|
|
46
|
-
'[data-testid="refine-toggle__modal-view-results-button"]',
|
|
47
|
-
modalContent: '[data-testid="refine-toggle__modal-content"]',
|
|
48
|
-
activeFiltersBadge: '[data-testid="refine-toggle__active-filters-badge"]',
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const initialSearchStatusState = {
|
|
52
|
-
hasError: false,
|
|
53
|
-
hasResults: true,
|
|
54
|
-
};
|
|
55
|
-
let searchStatusState = initialSearchStatusState;
|
|
56
|
-
|
|
57
|
-
const initialQuerySummaryState = {};
|
|
58
|
-
let querySummaryState = initialQuerySummaryState;
|
|
59
|
-
|
|
60
|
-
const initialBreadcrumbManagerState = {};
|
|
61
|
-
let breadcrumbManagerState = initialBreadcrumbManagerState;
|
|
62
|
-
|
|
63
|
-
const functionsMocks = {
|
|
64
|
-
buildQuerySummary: jest.fn(() => ({
|
|
65
|
-
state: querySummaryState,
|
|
66
|
-
subscribe: functionsMocks.querySummaryStateSubscriber,
|
|
67
|
-
})),
|
|
68
|
-
buildBreadcrumbManager: jest.fn(() => ({
|
|
69
|
-
state: breadcrumbManagerState,
|
|
70
|
-
subscribe: functionsMocks.breadcrumbManagerStateSubscriber,
|
|
71
|
-
})),
|
|
72
|
-
buildSearchStatus: jest.fn(() => ({
|
|
73
|
-
state: searchStatusState,
|
|
74
|
-
subscribe: functionsMocks.searchStatusStateSubscriber,
|
|
75
|
-
})),
|
|
76
|
-
querySummaryStateSubscriber: jest.fn((cb) => {
|
|
77
|
-
cb();
|
|
78
|
-
return functionsMocks.querySummaryStateUnsubscriber;
|
|
79
|
-
}),
|
|
80
|
-
breadcrumbManagerStateSubscriber: jest.fn((cb) => {
|
|
81
|
-
cb();
|
|
82
|
-
return functionsMocks.breadcrumbManagerStateUnsubscriber;
|
|
83
|
-
}),
|
|
84
|
-
searchStatusStateSubscriber: jest.fn((cb) => {
|
|
85
|
-
cb();
|
|
86
|
-
return functionsMocks.searchStatusStateUnsubscriber;
|
|
87
|
-
}),
|
|
88
|
-
querySummaryStateUnsubscriber: jest.fn(),
|
|
89
|
-
breadcrumbManagerStateUnsubscriber: jest.fn(),
|
|
90
|
-
searchStatusStateUnsubscriber: jest.fn(),
|
|
91
|
-
retry: jest.fn(),
|
|
92
|
-
getAllFacetsFromStore: jest.fn(() => ({})),
|
|
93
|
-
eventHandler: jest.fn(),
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
const exampleEngine = {
|
|
97
|
-
id: 'example engine',
|
|
98
|
-
};
|
|
99
|
-
let isInitialized = false;
|
|
100
|
-
|
|
101
|
-
// @ts-ignore
|
|
102
|
-
mockHeadlessLoader.getAllFacetsFromStore = functionsMocks.getAllFacetsFromStore;
|
|
103
|
-
|
|
104
|
-
function prepareHeadlessState() {
|
|
105
|
-
// @ts-ignore
|
|
106
|
-
mockHeadlessLoader.getHeadlessBundle = () => {
|
|
107
|
-
return {
|
|
108
|
-
buildQuerySummary: functionsMocks.buildQuerySummary,
|
|
109
|
-
buildBreadcrumbManager: functionsMocks.buildBreadcrumbManager,
|
|
110
|
-
buildSearchStatus: functionsMocks.buildSearchStatus,
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function mockSuccessfulHeadlessInitialization() {
|
|
116
|
-
// @ts-ignore
|
|
117
|
-
mockHeadlessLoader.initializeWithHeadless = (element, _, initialize) => {
|
|
118
|
-
if (element instanceof QuanticRefineToggle && !isInitialized) {
|
|
119
|
-
isInitialized = true;
|
|
120
|
-
initialize(exampleEngine);
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function mockErroneousHeadlessInitialization() {
|
|
126
|
-
// @ts-ignore
|
|
127
|
-
mockHeadlessLoader.initializeWithHeadless = (element) => {
|
|
128
|
-
if (element instanceof QuanticRefineToggle) {
|
|
129
|
-
element.setInitializationError();
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
describe('c-quantic-refine-toggle', () => {
|
|
135
|
-
beforeEach(() => {
|
|
136
|
-
mockSuccessfulHeadlessInitialization();
|
|
137
|
-
prepareHeadlessState();
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
afterEach(() => {
|
|
141
|
-
cleanup();
|
|
142
|
-
querySummaryState = initialQuerySummaryState;
|
|
143
|
-
breadcrumbManagerState = initialBreadcrumbManagerState;
|
|
144
|
-
searchStatusState = initialSearchStatusState;
|
|
145
|
-
isInitialized = false;
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
describe('when an initialization error occurs', () => {
|
|
149
|
-
beforeEach(() => {
|
|
150
|
-
mockErroneousHeadlessInitialization();
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
it('should display the initialization error component', async () => {
|
|
154
|
-
const element = createTestComponent();
|
|
155
|
-
await flushPromises();
|
|
156
|
-
|
|
157
|
-
const initializationError = element.shadowRoot.querySelector(
|
|
158
|
-
selectors.initializationError
|
|
159
|
-
);
|
|
160
|
-
|
|
161
|
-
expect(initializationError).not.toBeNull();
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
describe('controller initialization', () => {
|
|
166
|
-
beforeEach(() => {
|
|
167
|
-
mockSuccessfulHeadlessInitialization();
|
|
168
|
-
prepareHeadlessState();
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
it('should build the query summary, breadcrumb manager and search status controllers with the proper parameters', async () => {
|
|
172
|
-
createTestComponent();
|
|
173
|
-
await flushPromises();
|
|
174
|
-
|
|
175
|
-
expect(functionsMocks.buildQuerySummary).toHaveBeenCalledTimes(1);
|
|
176
|
-
expect(functionsMocks.buildQuerySummary).toHaveBeenCalledWith(
|
|
177
|
-
exampleEngine
|
|
178
|
-
);
|
|
179
|
-
expect(functionsMocks.buildBreadcrumbManager).toHaveBeenCalledTimes(1);
|
|
180
|
-
expect(functionsMocks.buildBreadcrumbManager).toHaveBeenCalledWith(
|
|
181
|
-
exampleEngine
|
|
182
|
-
);
|
|
183
|
-
expect(functionsMocks.buildSearchStatus).toHaveBeenCalledTimes(1);
|
|
184
|
-
expect(functionsMocks.buildSearchStatus).toHaveBeenCalledWith(
|
|
185
|
-
exampleEngine
|
|
186
|
-
);
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
it('should subscribe to the headless query summary, breadcrumb manager and search status state changes', async () => {
|
|
190
|
-
createTestComponent();
|
|
191
|
-
await flushPromises();
|
|
192
|
-
|
|
193
|
-
expect(functionsMocks.querySummaryStateSubscriber).toHaveBeenCalledTimes(
|
|
194
|
-
1
|
|
195
|
-
);
|
|
196
|
-
expect(
|
|
197
|
-
functionsMocks.breadcrumbManagerStateSubscriber
|
|
198
|
-
).toHaveBeenCalledTimes(1);
|
|
199
|
-
expect(functionsMocks.searchStatusStateSubscriber).toHaveBeenCalledTimes(
|
|
200
|
-
1
|
|
201
|
-
);
|
|
202
|
-
});
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
describe('the refine toggle', () => {
|
|
206
|
-
describe('when there are no results and no filters selected', () => {
|
|
207
|
-
beforeEach(() => {
|
|
208
|
-
searchStatusState = {...searchStatusState, hasResults: false};
|
|
209
|
-
breadcrumbManagerState = {
|
|
210
|
-
...breadcrumbManagerState,
|
|
211
|
-
hasBreadcrumbs: false,
|
|
212
|
-
};
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
it('should disable the refine button', async () => {
|
|
216
|
-
const element = createTestComponent();
|
|
217
|
-
await flushPromises();
|
|
218
|
-
|
|
219
|
-
const refineToggleButton = element.shadowRoot.querySelector(
|
|
220
|
-
selectors.refineToggleButton
|
|
221
|
-
);
|
|
222
|
-
|
|
223
|
-
expect(refineToggleButton).not.toBeNull();
|
|
224
|
-
expect(refineToggleButton.disabled).toBe(true);
|
|
225
|
-
});
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
describe('when filters are selected despite having no results', () => {
|
|
229
|
-
beforeEach(() => {
|
|
230
|
-
searchStatusState = {...searchStatusState, hasResults: false};
|
|
231
|
-
breadcrumbManagerState = {
|
|
232
|
-
...breadcrumbManagerState,
|
|
233
|
-
facetBreadcrumbs: [{values: [{}]}],
|
|
234
|
-
hasBreadcrumbs: true,
|
|
235
|
-
};
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
it('should enable the refine button', async () => {
|
|
239
|
-
const element = createTestComponent();
|
|
240
|
-
await flushPromises();
|
|
241
|
-
|
|
242
|
-
const refineToggleButton = element.shadowRoot.querySelector(
|
|
243
|
-
selectors.refineToggleButton
|
|
244
|
-
);
|
|
245
|
-
|
|
246
|
-
expect(refineToggleButton).not.toBeNull();
|
|
247
|
-
expect(refineToggleButton.disabled).toBe(false);
|
|
248
|
-
});
|
|
249
|
-
});
|
|
250
|
-
|
|
251
|
-
describe('when results are available even if no filters are selected', () => {
|
|
252
|
-
beforeEach(() => {
|
|
253
|
-
searchStatusState = {...searchStatusState, hasResults: true};
|
|
254
|
-
breadcrumbManagerState = {
|
|
255
|
-
...breadcrumbManagerState,
|
|
256
|
-
hasBreadcrumbs: false,
|
|
257
|
-
};
|
|
258
|
-
});
|
|
259
|
-
|
|
260
|
-
it('should enable the refine button', async () => {
|
|
261
|
-
const element = createTestComponent();
|
|
262
|
-
await flushPromises();
|
|
263
|
-
|
|
264
|
-
const refineToggleButton = element.shadowRoot.querySelector(
|
|
265
|
-
selectors.refineToggleButton
|
|
266
|
-
);
|
|
267
|
-
|
|
268
|
-
expect(refineToggleButton).not.toBeNull();
|
|
269
|
-
expect(refineToggleButton.disabled).toBe(false);
|
|
270
|
-
});
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
describe('when results are available and filters are selected', () => {
|
|
274
|
-
beforeEach(() => {
|
|
275
|
-
searchStatusState = {...searchStatusState, hasResults: true};
|
|
276
|
-
breadcrumbManagerState = {
|
|
277
|
-
...breadcrumbManagerState,
|
|
278
|
-
facetBreadcrumbs: [{values: [{}]}],
|
|
279
|
-
hasBreadcrumbs: true,
|
|
280
|
-
};
|
|
281
|
-
});
|
|
282
|
-
|
|
283
|
-
it('should enable the refine button', async () => {
|
|
284
|
-
const element = createTestComponent();
|
|
285
|
-
await flushPromises();
|
|
286
|
-
|
|
287
|
-
const refineToggleButton = element.shadowRoot.querySelector(
|
|
288
|
-
selectors.refineToggleButton
|
|
289
|
-
);
|
|
290
|
-
|
|
291
|
-
expect(refineToggleButton).not.toBeNull();
|
|
292
|
-
expect(refineToggleButton.disabled).toBe(false);
|
|
293
|
-
});
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
describe('when hideSort is set to false and no facet is rendered', () => {
|
|
297
|
-
it('should enable the refine button', async () => {
|
|
298
|
-
const element = createTestComponent({
|
|
299
|
-
...defaultOptions,
|
|
300
|
-
hideSort: false,
|
|
301
|
-
});
|
|
302
|
-
await flushPromises();
|
|
303
|
-
|
|
304
|
-
const refineToggleButton = element.shadowRoot.querySelector(
|
|
305
|
-
selectors.refineToggleButton
|
|
306
|
-
);
|
|
307
|
-
|
|
308
|
-
expect(refineToggleButton).not.toBeNull();
|
|
309
|
-
expect(refineToggleButton.disabled).toBe(false);
|
|
310
|
-
});
|
|
311
|
-
});
|
|
312
|
-
|
|
313
|
-
describe('when hideSort is set to true and no facet is rendered', () => {
|
|
314
|
-
it('should disable the refine button', async () => {
|
|
315
|
-
const element = createTestComponent({
|
|
316
|
-
...defaultOptions,
|
|
317
|
-
hideSort: true,
|
|
318
|
-
});
|
|
319
|
-
await flushPromises();
|
|
320
|
-
|
|
321
|
-
const refineToggleButton = element.shadowRoot.querySelector(
|
|
322
|
-
selectors.refineToggleButton
|
|
323
|
-
);
|
|
324
|
-
|
|
325
|
-
expect(refineToggleButton).not.toBeNull();
|
|
326
|
-
expect(refineToggleButton.disabled).toBe(true);
|
|
327
|
-
});
|
|
328
|
-
});
|
|
329
|
-
|
|
330
|
-
describe('when hideSort is set to true and a facet is rendered', () => {
|
|
331
|
-
it('should enable the refine button', async () => {
|
|
332
|
-
const element = createTestComponent({
|
|
333
|
-
...defaultOptions,
|
|
334
|
-
hideSort: true,
|
|
335
|
-
});
|
|
336
|
-
const renderFacetEvent = new CustomEvent('quantic__renderfacet', {
|
|
337
|
-
detail: {
|
|
338
|
-
id: 'example id',
|
|
339
|
-
shouldRenderFacet: true,
|
|
340
|
-
},
|
|
341
|
-
});
|
|
342
|
-
element.dispatchEvent(renderFacetEvent);
|
|
343
|
-
|
|
344
|
-
await flushPromises();
|
|
345
|
-
|
|
346
|
-
const refineToggleButton = element.shadowRoot.querySelector(
|
|
347
|
-
selectors.refineToggleButton
|
|
348
|
-
);
|
|
349
|
-
|
|
350
|
-
expect(refineToggleButton).not.toBeNull();
|
|
351
|
-
expect(refineToggleButton.disabled).toBe(false);
|
|
352
|
-
});
|
|
353
|
-
});
|
|
354
|
-
|
|
355
|
-
describe('when the refine toggle is clicked', () => {
|
|
356
|
-
beforeEach(() => {
|
|
357
|
-
searchStatusState = {...searchStatusState, hasResults: true};
|
|
358
|
-
breadcrumbManagerState = {
|
|
359
|
-
...breadcrumbManagerState,
|
|
360
|
-
};
|
|
361
|
-
});
|
|
362
|
-
|
|
363
|
-
it('should dispatch the quantic__refinemodaltoggle event', async () => {
|
|
364
|
-
document.addEventListener(
|
|
365
|
-
'quantic__refinemodaltoggle',
|
|
366
|
-
// @ts-ignore
|
|
367
|
-
(event) => functionsMocks.eventHandler(event.detail),
|
|
368
|
-
{once: true}
|
|
369
|
-
);
|
|
370
|
-
|
|
371
|
-
const element = createTestComponent();
|
|
372
|
-
await flushPromises();
|
|
373
|
-
|
|
374
|
-
const refineToggleButton = element.shadowRoot.querySelector(
|
|
375
|
-
selectors.refineToggleButton
|
|
376
|
-
);
|
|
377
|
-
|
|
378
|
-
expect(refineToggleButton).not.toBeNull();
|
|
379
|
-
await refineToggleButton.click();
|
|
380
|
-
|
|
381
|
-
expect(functionsMocks.eventHandler).toHaveBeenCalledTimes(1);
|
|
382
|
-
expect(functionsMocks.eventHandler).toHaveBeenCalledWith({
|
|
383
|
-
isOpen: true,
|
|
384
|
-
});
|
|
385
|
-
});
|
|
386
|
-
});
|
|
387
|
-
});
|
|
388
|
-
|
|
389
|
-
describe('the active filters badge', () => {
|
|
390
|
-
describe('when there is no active filters', () => {
|
|
391
|
-
beforeEach(() => {
|
|
392
|
-
breadcrumbManagerState = {
|
|
393
|
-
...breadcrumbManagerState,
|
|
394
|
-
hasBreadcrumbs: false,
|
|
395
|
-
};
|
|
396
|
-
});
|
|
397
|
-
|
|
398
|
-
it('should not display the active filters badge', async () => {
|
|
399
|
-
const element = createTestComponent({
|
|
400
|
-
...defaultOptions,
|
|
401
|
-
});
|
|
402
|
-
await flushPromises();
|
|
403
|
-
|
|
404
|
-
const activeFiltersBadge = element.shadowRoot.querySelector(
|
|
405
|
-
selectors.activeFiltersBadge
|
|
406
|
-
);
|
|
407
|
-
|
|
408
|
-
expect(activeFiltersBadge).toBeNull();
|
|
409
|
-
});
|
|
410
|
-
});
|
|
411
|
-
|
|
412
|
-
describe('when there are active filters', () => {
|
|
413
|
-
const exampleActiveFiltersCount = 3;
|
|
414
|
-
beforeEach(() => {
|
|
415
|
-
breadcrumbManagerState = {
|
|
416
|
-
...breadcrumbManagerState,
|
|
417
|
-
facetBreadcrumbs: [{values: new Array(exampleActiveFiltersCount)}],
|
|
418
|
-
hasBreadcrumbs: true,
|
|
419
|
-
};
|
|
420
|
-
});
|
|
421
|
-
|
|
422
|
-
it('should display the active filters badge', async () => {
|
|
423
|
-
const element = createTestComponent({
|
|
424
|
-
...defaultOptions,
|
|
425
|
-
});
|
|
426
|
-
await flushPromises();
|
|
427
|
-
|
|
428
|
-
const activeFiltersBadge = element.shadowRoot.querySelector(
|
|
429
|
-
selectors.activeFiltersBadge
|
|
430
|
-
);
|
|
431
|
-
|
|
432
|
-
expect(activeFiltersBadge).not.toBeNull();
|
|
433
|
-
expect(activeFiltersBadge.textContent).toBe(
|
|
434
|
-
exampleActiveFiltersCount.toString()
|
|
435
|
-
);
|
|
436
|
-
});
|
|
437
|
-
});
|
|
438
|
-
});
|
|
439
|
-
|
|
440
|
-
describe('the refine modal', () => {
|
|
441
|
-
describe('when the property fullScreen is set to true', () => {
|
|
442
|
-
it('should set the property fullScreen to true in the modal', async () => {
|
|
443
|
-
const element = createTestComponent({
|
|
444
|
-
...defaultOptions,
|
|
445
|
-
fullScreen: true,
|
|
446
|
-
});
|
|
447
|
-
await flushPromises();
|
|
448
|
-
|
|
449
|
-
const modal = element.shadowRoot.querySelector(selectors.modal);
|
|
450
|
-
|
|
451
|
-
expect(modal).not.toBeNull();
|
|
452
|
-
expect(modal.fullScreen).toBe(true);
|
|
453
|
-
});
|
|
454
|
-
});
|
|
455
|
-
|
|
456
|
-
describe('when the refine modal close button is clicked', () => {
|
|
457
|
-
it('should dispatch the quantic__refinemodaltoggle event', async () => {
|
|
458
|
-
document.addEventListener(
|
|
459
|
-
'quantic__refinemodaltoggle',
|
|
460
|
-
// @ts-ignore
|
|
461
|
-
(event) => functionsMocks.eventHandler(event.detail),
|
|
462
|
-
{once: true}
|
|
463
|
-
);
|
|
464
|
-
|
|
465
|
-
const element = createTestComponent();
|
|
466
|
-
await flushPromises();
|
|
467
|
-
|
|
468
|
-
const modalCloseButton = element.shadowRoot.querySelector(
|
|
469
|
-
selectors.modalCloseButton
|
|
470
|
-
);
|
|
471
|
-
|
|
472
|
-
expect(modalCloseButton).not.toBeNull();
|
|
473
|
-
await modalCloseButton.click();
|
|
474
|
-
|
|
475
|
-
expect(functionsMocks.eventHandler).toHaveBeenCalledTimes(1);
|
|
476
|
-
expect(functionsMocks.eventHandler).toHaveBeenCalledWith({
|
|
477
|
-
isOpen: false,
|
|
478
|
-
});
|
|
479
|
-
});
|
|
480
|
-
});
|
|
481
|
-
|
|
482
|
-
describe('when the refine modal view results button is clicked', () => {
|
|
483
|
-
it('should dispatch the quantic__refinemodaltoggle event', async () => {
|
|
484
|
-
document.addEventListener(
|
|
485
|
-
'quantic__refinemodaltoggle',
|
|
486
|
-
// @ts-ignore
|
|
487
|
-
(event) => functionsMocks.eventHandler(event.detail),
|
|
488
|
-
{once: true}
|
|
489
|
-
);
|
|
490
|
-
|
|
491
|
-
const element = createTestComponent();
|
|
492
|
-
await flushPromises();
|
|
493
|
-
|
|
494
|
-
const modalViewResultsButton = element.shadowRoot.querySelector(
|
|
495
|
-
selectors.modalViewResultsButton
|
|
496
|
-
);
|
|
497
|
-
|
|
498
|
-
expect(modalViewResultsButton).not.toBeNull();
|
|
499
|
-
await modalViewResultsButton.click();
|
|
500
|
-
|
|
501
|
-
expect(functionsMocks.eventHandler).toHaveBeenCalledTimes(1);
|
|
502
|
-
expect(functionsMocks.eventHandler).toHaveBeenCalledWith({
|
|
503
|
-
isOpen: false,
|
|
504
|
-
});
|
|
505
|
-
});
|
|
506
|
-
});
|
|
507
|
-
});
|
|
508
|
-
|
|
509
|
-
describe('the refine modal content', () => {
|
|
510
|
-
describe('when the property hideSort is set to true', () => {
|
|
511
|
-
it('should set the property hideSort to true in the modal content', async () => {
|
|
512
|
-
const element = createTestComponent({
|
|
513
|
-
...defaultOptions,
|
|
514
|
-
hideSort: true,
|
|
515
|
-
});
|
|
516
|
-
await flushPromises();
|
|
517
|
-
|
|
518
|
-
const modalContent = element.shadowRoot.querySelector(
|
|
519
|
-
selectors.modalContent
|
|
520
|
-
);
|
|
521
|
-
|
|
522
|
-
expect(modalContent).not.toBeNull();
|
|
523
|
-
expect(modalContent.hideSort).toBe(true);
|
|
524
|
-
});
|
|
525
|
-
});
|
|
526
|
-
|
|
527
|
-
describe('when the property disableDynamicNavigation is set to true', () => {
|
|
528
|
-
it('should set the property disableDynamicNavigation to true in the modal content', async () => {
|
|
529
|
-
const element = createTestComponent({
|
|
530
|
-
...defaultOptions,
|
|
531
|
-
disableDynamicNavigation: true,
|
|
532
|
-
});
|
|
533
|
-
await flushPromises();
|
|
534
|
-
|
|
535
|
-
const modalContent = element.shadowRoot.querySelector(
|
|
536
|
-
selectors.modalContent
|
|
537
|
-
);
|
|
538
|
-
|
|
539
|
-
expect(modalContent).not.toBeNull();
|
|
540
|
-
expect(modalContent.disableDynamicNavigation).toBe(true);
|
|
541
|
-
});
|
|
542
|
-
});
|
|
543
|
-
});
|
|
544
|
-
});
|