@k-int/stripes-kint-components 5.31.3 → 5.31.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +1 -1
- package/es/lib/SASQLookupComponent/SASQLookupComponent.test.js +540 -0
- package/es/lib/SASQLookupComponent/TableBody/TableBody.js +9 -5
- package/es/lib/SASQLookupComponent/TableBody/TableBody.test.js +253 -0
- package/es/lib/SASQLookupComponent/__mocks__/SASQLookupComponent.js +33 -0
- package/es/lib/SASQLookupComponent/__mocks__/SASQLookupComponentRender.js +24 -0
- package/es/lib/SASQLookupComponent/__mocks__/index.js +20 -0
- package/es/lib/SASQRoute/SASQRoute.test.js +267 -0
- package/es/lib/SASQViewComponent/SASQViewComponent.test.js +104 -0
- package/es/lib/SASQViewComponent/__mocks__/SASQViewComponent.js +19 -0
- package/es/lib/SASQViewComponent/__mocks__/SASQViewComponentRender.js +19 -0
- package/es/lib/SASQViewComponent/__mocks__/index.js +20 -0
- package/es/lib/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js +1 -1
- package/package.json +5 -1
- package/src/artifacts/coverage-jest/ActionList/ActionList.js.html +4 -4
- package/src/artifacts/coverage-jest/ActionList/ActionListFieldArray.js.html +10 -10
- package/src/artifacts/coverage-jest/ActionList/index.html +1 -1
- package/src/artifacts/coverage-jest/ActionList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ButtonTypedown/ButtonTypedown.js.html +3 -3
- package/src/artifacts/coverage-jest/ButtonTypedown/index.html +1 -1
- package/src/artifacts/coverage-jest/ButtonTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ComboButton/ComboButton.js.html +3 -3
- package/src/artifacts/coverage-jest/ComboButton/index.html +1 -1
- package/src/artifacts/coverage-jest/ComboButton/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertiesLookup.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertiesSettings.js.html +6 -6
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertyForm.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Config/CustomPropertyView.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Config/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Config/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesEdit.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesEditCtx.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertiesListField.js.html +5 -5
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertyField.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Edit/CustomPropertyFormCard.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Edit/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Edit/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilter.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterField.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesFilterForm.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Filter/CustomPropertiesRule.js.html +4 -4
- package/src/artifacts/coverage-jest/CustomProperties/Filter/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useOperators.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useParseActiveFilterStrings.js.html +2 -2
- package/src/artifacts/coverage-jest/CustomProperties/Filter/useValueProps.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertiesView.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertiesViewCtx.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/View/CustomPropertyCard.js.html +3 -3
- package/src/artifacts/coverage-jest/CustomProperties/View/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/View/testResources.js.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/index.html +1 -1
- package/src/artifacts/coverage-jest/CustomProperties/index.js.html +1 -1
- package/src/artifacts/coverage-jest/CycleButton/CycleButton.js.html +3 -3
- package/src/artifacts/coverage-jest/CycleButton/index.html +1 -1
- package/src/artifacts/coverage-jest/CycleButton/index.js.html +1 -1
- package/src/artifacts/coverage-jest/FieldLabel/FieldLabel.js.html +2 -2
- package/src/artifacts/coverage-jest/FieldLabel/index.html +1 -1
- package/src/artifacts/coverage-jest/FieldLabel/index.js.html +1 -1
- package/src/artifacts/coverage-jest/FormModal/FormModal.js.html +3 -3
- package/src/artifacts/coverage-jest/FormModal/index.html +1 -1
- package/src/artifacts/coverage-jest/FormModal/index.js.html +1 -1
- package/src/artifacts/coverage-jest/FormattedKintMessage/FormattedKintMessage.js.html +3 -3
- package/src/artifacts/coverage-jest/FormattedKintMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/FormattedKintMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/IconSelect/IconSelect.js.html +3 -3
- package/src/artifacts/coverage-jest/IconSelect/index.html +1 -1
- package/src/artifacts/coverage-jest/IconSelect/index.js.html +1 -1
- package/src/artifacts/coverage-jest/NoResultsMessage/NoResultsMessage.js.html +3 -3
- package/src/artifacts/coverage-jest/NoResultsMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/NoResultsMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/NumberField/NumberField.js.html +3 -3
- package/src/artifacts/coverage-jest/NumberField/index.html +1 -1
- package/src/artifacts/coverage-jest/NumberField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/QueryTypedown/QueryTypedown.js.html +3 -3
- package/src/artifacts/coverage-jest/QueryTypedown/index.html +1 -1
- package/src/artifacts/coverage-jest/QueryTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/RefdataButtons/RefdataButtons.js.html +3 -3
- package/src/artifacts/coverage-jest/RefdataButtons/index.html +1 -1
- package/src/artifacts/coverage-jest/RefdataButtons/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ResponsiveButtonGroup/ResponsiveButtonGroup.js.html +6 -6
- package/src/artifacts/coverage-jest/ResponsiveButtonGroup/index.html +1 -1
- package/src/artifacts/coverage-jest/ResponsiveButtonGroup/index.js.html +1 -1
- package/src/artifacts/coverage-jest/ResponsiveButtonGroup/useResponsiveButtonGroupSizing.js.html +2 -2
- package/src/artifacts/coverage-jest/RichSelect/RichSelect.js.html +3 -3
- package/src/artifacts/coverage-jest/RichSelect/index.html +1 -1
- package/src/artifacts/coverage-jest/RichSelect/index.js.html +1 -1
- package/src/artifacts/coverage-jest/RichSelect/useSelectedOption.js.html +2 -2
- package/src/artifacts/coverage-jest/SASQLookupComponent/SASQLookupComponent.js.html +146 -149
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/TableBody.js.html +74 -65
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/index.html +21 -21
- package/src/artifacts/coverage-jest/SASQLookupComponent/TableBody/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQLookupComponent/index.html +21 -21
- package/src/artifacts/coverage-jest/SASQLookupComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQRoute/SASQRoute.js.html +43 -43
- package/src/artifacts/coverage-jest/SASQRoute/index.html +21 -21
- package/src/artifacts/coverage-jest/SASQRoute/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SASQViewComponent/SASQViewComponent.js.html +42 -42
- package/src/artifacts/coverage-jest/SASQViewComponent/index.html +21 -21
- package/src/artifacts/coverage-jest/SASQViewComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchField/SearchField.js.html +4 -4
- package/src/artifacts/coverage-jest/SearchField/index.html +1 -1
- package/src/artifacts/coverage-jest/SearchField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/SearchKeyControl/SearchKeyControl.js.html +3 -3
- package/src/artifacts/coverage-jest/SearchKeyControl/index.html +1 -1
- package/src/artifacts/coverage-jest/SearchKeyControl/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/EditableRefdataCategoryList.js.html +4 -4
- package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataCategoryList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataList/EditableRefdataList.js.html +4 -4
- package/src/artifacts/coverage-jest/Settings/EditableRefdataList/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableRefdataList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsList.js.html +3 -3
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js.html +5 -5
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/EditableSettingsListFieldArray/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/EditSettingValue.js.html +3 -3
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/EditSettingValue/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/RenderSettingValue.js.html +3 -3
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/RenderSettingValue/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/SettingField.js.html +3 -3
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/SettingField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/EditableSettingsList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/RefdataCategoriesSettings.js.html +4 -4
- package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/RefdataCategoriesSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPage.js.html +3 -3
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/SettingPagePane.js.html +3 -3
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/SettingPagePane/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingPage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/SettingsFormContainer.js.html +3 -3
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/SettingsFormContainer/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsField.js.html +3 -3
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/StaticSettingsFieldComponent.js.html +2 -2
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/StaticSettingsFieldComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/StaticSettingsField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/constants/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/constants/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/constants/queryKeys.js.html +5 -5
- package/src/artifacts/coverage-jest/Settings/contexts/SettingsContext.js.html +2 -2
- package/src/artifacts/coverage-jest/Settings/contexts/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/contexts/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingCallout/useSettingCallout.js.html +2 -2
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useSettingsSectionInitalValues/useSettingsSectionInitalValues.js.html +2 -2
- package/src/artifacts/coverage-jest/Settings/hooks/staticSettingsPages/useStaticSettingsSection.js.html +2 -2
- package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useAppSettings/useAppSettings.js.html +2 -2
- package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettingSection/useSettingSection.js.html +2 -2
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Settings/hooks/useSettings/useSettings.js.html +2 -2
- package/src/artifacts/coverage-jest/Settings/index.html +1 -1
- package/src/artifacts/coverage-jest/Settings/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/Tags.js.html +3 -3
- package/src/artifacts/coverage-jest/Tags/hooks/index.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/hooks/useTags.js.html +2 -2
- package/src/artifacts/coverage-jest/Tags/hooks/useTagsEnabled.js.html +8 -8
- package/src/artifacts/coverage-jest/Tags/index.html +1 -1
- package/src/artifacts/coverage-jest/Tags/index.js.html +1 -1
- package/src/artifacts/coverage-jest/Tags/tagsConfig.js.html +5 -5
- package/src/artifacts/coverage-jest/Typedown/Typedown.js.html +3 -3
- package/src/artifacts/coverage-jest/Typedown/index.html +1 -1
- package/src/artifacts/coverage-jest/Typedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/cobertura-coverage.xml +652 -650
- package/src/artifacts/coverage-jest/constants/comparators.js.html +1 -1
- package/src/artifacts/coverage-jest/constants/customProperties.js.html +12 -12
- package/src/artifacts/coverage-jest/constants/endpoints.js.html +4 -4
- package/src/artifacts/coverage-jest/constants/eventCodes.js.html +4 -4
- package/src/artifacts/coverage-jest/constants/index.html +1 -1
- package/src/artifacts/coverage-jest/constants/pagination.js.html +6 -6
- package/src/artifacts/coverage-jest/hooks/index.html +51 -51
- package/src/artifacts/coverage-jest/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKey/useIntlKey.js.html +8 -8
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useIntlKeyStore/useIntlKeyStore.js.html +12 -12
- package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/intlHooks/useKintIntl/useKintIntl.js.html +10 -10
- package/src/artifacts/coverage-jest/hooks/typedownHooks/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedown.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedownData.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/typedownHooks/useTypedownToggle.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useActionListRef.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useActiveElement.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useCustomProperties.js.html +3 -3
- package/src/artifacts/coverage-jest/hooks/useHelperApp.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useInvalidateRefdata/useInvalidateRefdata.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useKiwtFieldArray.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useKiwtSASQuery.js.html +48 -48
- package/src/artifacts/coverage-jest/hooks/useLocalPageStore.js.html +3 -3
- package/src/artifacts/coverage-jest/hooks/useLocalStorageState.js.html +22 -22
- package/src/artifacts/coverage-jest/hooks/useModConfigEntries.js.html +3 -3
- package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateCustomProperties/useMutateCustomProperties.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/index.js.html +5 -2
- package/src/artifacts/coverage-jest/hooks/useMutateGeneric/useMutateGeneric.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useMutateModConfigEntry.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataCategory/useMutateRefdataCategory.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useMutateRefdataValue/useMutateRefdataValue.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/usePrevNextPagination.js.html +68 -68
- package/src/artifacts/coverage-jest/hooks/useQIndex.js.html +28 -28
- package/src/artifacts/coverage-jest/hooks/useRefdata.js.html +3 -3
- package/src/artifacts/coverage-jest/hooks/useSASQQueryMeta.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/index.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/index.js.html +1 -1
- package/src/artifacts/coverage-jest/hooks/useStandaloneSASQQueryParameter/useStandaloneSASQQueryParameter.js.html +2 -2
- package/src/artifacts/coverage-jest/hooks/useTemplates.js.html +2 -2
- package/src/artifacts/coverage-jest/index.html +84 -84
- package/src/artifacts/coverage-jest/utils/buildUrl.js.html +34 -34
- package/src/artifacts/coverage-jest/utils/filterParsers/deparseKiwtQueryFilters.js.html +3 -3
- package/src/artifacts/coverage-jest/utils/filterParsers/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryFilters.js.html +3 -3
- package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryGroups.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/filterParsers/parseKiwtQueryString.js.html +5 -5
- package/src/artifacts/coverage-jest/utils/generateKiwtQuery.js.html +7 -7
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/generateKiwtQueryParams.js.html +67 -67
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/index.html +21 -21
- package/src/artifacts/coverage-jest/utils/generateKiwtQueryParams/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/groupCustomPropertiesByCtx.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/highlightString.js.html +3 -3
- package/src/artifacts/coverage-jest/utils/index.html +22 -22
- package/src/artifacts/coverage-jest/utils/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/matchString.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/modConfigEntriesQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/parseErrorResponse.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/parseModConfigEntry.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/refdataOptions.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/refdataQueryKey/index.html +1 -1
- package/src/artifacts/coverage-jest/utils/refdataQueryKey/index.js.html +1 -1
- package/src/artifacts/coverage-jest/utils/refdataQueryKey/refdataQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/selectorSafe.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/sortByLabel.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/toCamelCase.js.html +2 -2
- package/src/artifacts/coverage-jest/utils/typedownQueryKey.js.html +2 -2
- package/src/artifacts/coverage-jest/validators/index.html +1 -1
- package/src/artifacts/coverage-jest/validators/index.js.html +1 -1
- package/src/artifacts/coverage-jest/validators/validators.js.html +8 -8
- package/src/lib/SASQLookupComponent/SASQLookupComponent.js +3 -4
- package/src/lib/SASQLookupComponent/SASQLookupComponent.test.js +495 -0
- package/src/lib/SASQLookupComponent/TableBody/TableBody.js +6 -3
- package/src/lib/SASQLookupComponent/TableBody/TableBody.test.js +247 -0
- package/src/lib/SASQLookupComponent/__mocks__/SASQLookupComponent.js +31 -0
- package/src/lib/SASQLookupComponent/__mocks__/SASQLookupComponentRender.js +20 -0
- package/src/lib/SASQLookupComponent/__mocks__/index.js +2 -0
- package/src/lib/SASQRoute/SASQRoute.test.js +281 -0
- package/src/lib/SASQViewComponent/SASQViewComponent.test.js +114 -0
- package/src/lib/SASQViewComponent/__mocks__/SASQViewComponent.js +13 -0
- package/src/lib/SASQViewComponent/__mocks__/SASQViewComponentRender.js +17 -0
- package/src/lib/SASQViewComponent/__mocks__/index.js +2 -0
- package/src/lib/Settings/EditableSettingsList/EditableSettingsListFieldArray/EditableSettingsListFieldArray.js +1 -1
- package/src/lib/hooks/useMutateGeneric/index.js +1 -1
- package/test/helpers/test-implementor-translations.json +2 -1
- package/test/helpers/translationsProperties.js +1 -1
- package/test/jest/setupTests.js +1 -1
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
import { createRef } from 'react';
|
|
2
|
+
|
|
3
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
4
|
+
|
|
5
|
+
import { waitFor } from '@folio/jest-config-stripes/testing-library/react';
|
|
6
|
+
|
|
7
|
+
import { mockKy } from '@folio/stripes/core';
|
|
8
|
+
import { Button as MockStripesButton } from '@folio/stripes/components';
|
|
9
|
+
import {
|
|
10
|
+
Button,
|
|
11
|
+
SearchField,
|
|
12
|
+
Pane,
|
|
13
|
+
IconButton
|
|
14
|
+
} from '@folio/stripes-erm-testing';
|
|
15
|
+
|
|
16
|
+
import { useQuery } from 'react-query';
|
|
17
|
+
import { renderWithKintHarness } from '../../../test/jest';
|
|
18
|
+
import SASQLookupComponent from './SASQLookupComponent';
|
|
19
|
+
import translationsProperties from '../../../test/helpers';
|
|
20
|
+
|
|
21
|
+
jest.mock('react-query', () => {
|
|
22
|
+
const { mockReactQuery } = jest.requireActual('@folio/stripes-erm-testing');
|
|
23
|
+
return {
|
|
24
|
+
...jest.requireActual('react-query'),
|
|
25
|
+
...mockReactQuery,
|
|
26
|
+
useQuery: jest.fn((_key, func, opts) => {
|
|
27
|
+
const defaultData = {
|
|
28
|
+
results: [
|
|
29
|
+
{ id: 1, someData: false, test: 'wibble' },
|
|
30
|
+
{ id: 2, someData: true, test: 'wobble' }
|
|
31
|
+
],
|
|
32
|
+
totalRecords: 2
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// Mock ensures the function is called so we can test outcomes
|
|
36
|
+
if (opts.enabled) {
|
|
37
|
+
func();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (opts.select) {
|
|
41
|
+
return ({
|
|
42
|
+
data: opts.select(defaultData),
|
|
43
|
+
extraProp: 'extraProp'
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return ({
|
|
48
|
+
data: defaultData,
|
|
49
|
+
extraProp: 'extraProp'
|
|
50
|
+
});
|
|
51
|
+
}),
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// TODO why does unmocking react-router-dom cause module hierarchy issues?
|
|
56
|
+
// EXAMPLE mocking react-router-dom
|
|
57
|
+
const mockHistoryPush = jest.fn();
|
|
58
|
+
const mockHistoryReplace = jest.fn();
|
|
59
|
+
jest.mock('react-router-dom', () => {
|
|
60
|
+
const { mockReactRouterDom } = jest.requireActual('@folio/stripes-erm-testing');
|
|
61
|
+
const actualReactRouterDom = jest.requireActual('react-router-dom');
|
|
62
|
+
|
|
63
|
+
return ({
|
|
64
|
+
...actualReactRouterDom,
|
|
65
|
+
...mockReactRouterDom,
|
|
66
|
+
useHistory: jest.fn(() => ({ push: mockHistoryPush, replace: mockHistoryReplace })),
|
|
67
|
+
useLocation: actualReactRouterDom.useLocation, // Bit ugly... idk why I need to put this back specifically like this instead of just unmocking react-router-dom
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
jest.mock('./TableBody', () => jest.fn(({ mclProps }) => (
|
|
72
|
+
<div>
|
|
73
|
+
<div>TableBody</div>
|
|
74
|
+
{/* This allows our interactors to find and click a pagination trigger */}
|
|
75
|
+
<MockStripesButton
|
|
76
|
+
onClick={() => mclProps.onNeedMoreData(null, 1)}
|
|
77
|
+
>
|
|
78
|
+
Next Page
|
|
79
|
+
</MockStripesButton>
|
|
80
|
+
</div>
|
|
81
|
+
)));
|
|
82
|
+
|
|
83
|
+
jest.mock('../SearchKeyControl', () => jest.fn(() => <div>SearchKeyControl</div>));
|
|
84
|
+
|
|
85
|
+
const fetchParameters = {
|
|
86
|
+
endpoint: '/wibble',
|
|
87
|
+
SASQ_MAP: {
|
|
88
|
+
searchKey: 'test.test1.test2,test3',
|
|
89
|
+
filterKeys: {
|
|
90
|
+
status: 'status.value',
|
|
91
|
+
wobble: 'wobble.value',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const baseSASQLookupProps = {
|
|
97
|
+
id: 'testing-sasq-lookup-component',
|
|
98
|
+
path: 'the-path', // Required as it's needed for children
|
|
99
|
+
fetchParameters
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const baseSASQObj = { filters: '', qindex: undefined, query: '' };
|
|
103
|
+
const getBaseExpectedQueryNamespace = (obj = baseSASQLookupProps) => ([
|
|
104
|
+
'@folio/test-implementor',
|
|
105
|
+
'SASQ',
|
|
106
|
+
'testing-sasq-lookup-component',
|
|
107
|
+
'viewAll',
|
|
108
|
+
obj,
|
|
109
|
+
1
|
|
110
|
+
]);
|
|
111
|
+
|
|
112
|
+
let renderComponent;
|
|
113
|
+
let theRef;
|
|
114
|
+
describe('SASQLookupComponent', () => {
|
|
115
|
+
describe.each([
|
|
116
|
+
{
|
|
117
|
+
testLabel: 'default behaviour',
|
|
118
|
+
props: baseSASQLookupProps,
|
|
119
|
+
expectQueryFire: false,
|
|
120
|
+
expectedMockKyCall: '/wibble?filters=status.value%3D%3DtestFilter&stats=true&page=1',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
testLabel: 'with searchable indexes',
|
|
124
|
+
props: {
|
|
125
|
+
...baseSASQLookupProps,
|
|
126
|
+
searchableIndexes: [{ key: 'name', label: 'Name' }]
|
|
127
|
+
},
|
|
128
|
+
expectQueryFire: false, // No actual query yet
|
|
129
|
+
expectedSearchKeyControl: true,
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
testLabel: 'starting with filters',
|
|
133
|
+
props: baseSASQLookupProps,
|
|
134
|
+
startingLocation: '/wibble?filters=status.testFilter',
|
|
135
|
+
expectedQueryNamespace: getBaseExpectedQueryNamespace({
|
|
136
|
+
filters: 'status.testFilter',
|
|
137
|
+
qindex: undefined,
|
|
138
|
+
query: ''
|
|
139
|
+
}),
|
|
140
|
+
expectedMockKyCall: '/wibble?filters=status.value%3D%3DtestFilter&stats=true&page=1',
|
|
141
|
+
expectedMockKyCallAfterSearch: '/wibble?match=test.test1.test2&match=test3&term=some%20test%20query&filters=status.value%3D%3DtestFilter&stats=true&page=1',
|
|
142
|
+
expectedRef: {
|
|
143
|
+
lookupQueryProps: {
|
|
144
|
+
data: {
|
|
145
|
+
results: [{ 'id': 1, 'someData': false, 'test': 'wibble' }, { 'id': 2, 'someData': true, 'test': 'wobble' }],
|
|
146
|
+
totalRecords: 2
|
|
147
|
+
},
|
|
148
|
+
'extraProp': 'extraProp'
|
|
149
|
+
},
|
|
150
|
+
queryParams: '?filters=status.value%3D%3DtestFilter&stats=true&page=1'
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
testLabel: 'starting with qindex and no query',
|
|
155
|
+
props: baseSASQLookupProps,
|
|
156
|
+
startingLocation: '/wibble?qindex=test.test1.test2',
|
|
157
|
+
expectQueryFire: false,
|
|
158
|
+
expectedQueryNamespace: getBaseExpectedQueryNamespace({
|
|
159
|
+
filters: '',
|
|
160
|
+
qindex: 'test.test1.test2',
|
|
161
|
+
query: ''
|
|
162
|
+
}),
|
|
163
|
+
expectedMockKyCallAfterSearch: '/wibble?match=test.test1.test2&term=some%20test%20query&stats=true&page=1',
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
testLabel: 'starting with qindex and query',
|
|
167
|
+
props: {
|
|
168
|
+
...baseSASQLookupProps,
|
|
169
|
+
sasqProps: {
|
|
170
|
+
initialSearchState: { query: 'hello', qindex: 'test.test1.test2' },
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
startingLocation: '/wibble?qindex=some.new.qindex.path&query=hello',
|
|
174
|
+
expectedQueryNamespace: getBaseExpectedQueryNamespace({
|
|
175
|
+
filters: '',
|
|
176
|
+
qindex: 'some.new.qindex.path',
|
|
177
|
+
query: 'hello'
|
|
178
|
+
}),
|
|
179
|
+
expectedMockKyCall: '/wibble?match=some.new.qindex.path&term=hello&stats=true&page=1',
|
|
180
|
+
expectedMockKyCallAfterSearch: '/wibble?match=some.new.qindex.path&term=some%20test%20query&stats=true&page=1',
|
|
181
|
+
expectedRef: {
|
|
182
|
+
lookupQueryProps: {
|
|
183
|
+
data: {
|
|
184
|
+
results: [{ 'id': 1, 'someData': false, 'test': 'wibble' }, { 'id': 2, 'someData': true, 'test': 'wobble' }],
|
|
185
|
+
totalRecords: 2
|
|
186
|
+
},
|
|
187
|
+
'extraProp': 'extraProp'
|
|
188
|
+
},
|
|
189
|
+
queryParams: '?match=some.new.qindex.path&term=hello&stats=true&page=1'
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
testLabel: 'with FilterComponent',
|
|
194
|
+
props: {
|
|
195
|
+
...baseSASQLookupProps,
|
|
196
|
+
FilterComponent: () => <div>FilterComponent</div>
|
|
197
|
+
},
|
|
198
|
+
expectQueryFire: false,
|
|
199
|
+
expectedMockKyCall: '/wibble?filters=status.value%3D%3DtestFilter&stats=true&page=1',
|
|
200
|
+
expectedFilterComponent: 'FilterComponent',
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
testLabel: 'with filter pane disabled',
|
|
204
|
+
props: {
|
|
205
|
+
...baseSASQLookupProps,
|
|
206
|
+
hasFilterPane: false
|
|
207
|
+
},
|
|
208
|
+
expectQueryFire: false,
|
|
209
|
+
expectedSearchField :false,
|
|
210
|
+
expectedFilterPane: false,
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
testLabel: 'with FilterHeaderComponent',
|
|
214
|
+
props: {
|
|
215
|
+
...baseSASQLookupProps,
|
|
216
|
+
FilterPaneHeaderComponent: () => <div>FilterPaneHeaderComponent</div>
|
|
217
|
+
},
|
|
218
|
+
expectQueryFire: false,
|
|
219
|
+
expectedMockKyCall: '/wibble?filters=status.value%3D%3DtestFilter&stats=true&page=1',
|
|
220
|
+
expectedFilterHeaderComponent: 'FilterPaneHeaderComponent',
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
testLabel: 'no search field mode',
|
|
224
|
+
props: {
|
|
225
|
+
...baseSASQLookupProps,
|
|
226
|
+
noSearchField: true
|
|
227
|
+
},
|
|
228
|
+
expectQueryFire: false,
|
|
229
|
+
expectedSearchField: false,
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
testLabel: 'with RenderBody',
|
|
233
|
+
props: {
|
|
234
|
+
...baseSASQLookupProps,
|
|
235
|
+
RenderBody: () => <div>TheBodyComponent</div>
|
|
236
|
+
},
|
|
237
|
+
expectQueryFire: false,
|
|
238
|
+
expectedMockKyCall: '/wibble?filters=status.value%3D%3DtestFilter&stats=true&page=1',
|
|
239
|
+
expectedBodyComponent: 'TheBodyComponent',
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
testLabel: 'with custom lookupQueryNamespaceGenerator',
|
|
243
|
+
props: {
|
|
244
|
+
...baseSASQLookupProps,
|
|
245
|
+
lookupQueryNamespaceGenerator: ({
|
|
246
|
+
currentPage,
|
|
247
|
+
namespace,
|
|
248
|
+
id: passedId,
|
|
249
|
+
}) => [`testing-${currentPage}`, `testing-${namespace}`, `testing-${passedId}`],
|
|
250
|
+
},
|
|
251
|
+
expectedQueryNamespace: ['testing-1', 'testing-@folio/test-implementor', 'testing-testing-sasq-lookup-component'],
|
|
252
|
+
startingLocation: '/wibble?filters=status.testFilter',
|
|
253
|
+
expectedMockKyCall: '/wibble?filters=status.value%3D%3DtestFilter&stats=true&page=1',
|
|
254
|
+
expectedMockKyCallAfterSearch: '/wibble?match=test.test1.test2&match=test3&term=some%20test%20query&filters=status.value%3D%3DtestFilter&stats=true&page=1',
|
|
255
|
+
expectedRef: {
|
|
256
|
+
lookupQueryProps: {
|
|
257
|
+
data: {
|
|
258
|
+
results: [{ 'id': 1, 'someData': false, 'test': 'wibble' }, { 'id': 2, 'someData': true, 'test': 'wobble' }],
|
|
259
|
+
totalRecords: 2
|
|
260
|
+
},
|
|
261
|
+
'extraProp': 'extraProp'
|
|
262
|
+
},
|
|
263
|
+
queryParams: '?filters=status.value%3D%3DtestFilter&stats=true&page=1'
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
testLabel: 'with lookupResponseTransform',
|
|
268
|
+
props: {
|
|
269
|
+
...baseSASQLookupProps,
|
|
270
|
+
sasqProps: {
|
|
271
|
+
initialSearchState: { query: 'test', qindex: 'test.test1.test2' },
|
|
272
|
+
},
|
|
273
|
+
// Wrap results in an extra object to prove transform works
|
|
274
|
+
lookupResponseTransform: (resp) => ({ originalData: resp, transformed: true }),
|
|
275
|
+
},
|
|
276
|
+
startingLocation: '/wibble?query=test',
|
|
277
|
+
expectedQueryNamespace: getBaseExpectedQueryNamespace({
|
|
278
|
+
filters: '',
|
|
279
|
+
qindex: undefined,
|
|
280
|
+
query: 'test'
|
|
281
|
+
}),
|
|
282
|
+
expectedMockKyCall: '/wibble?match=test.test1.test2&match=test3&term=test&stats=true&page=1',
|
|
283
|
+
expectedRef: {
|
|
284
|
+
lookupQueryProps: {
|
|
285
|
+
data: {
|
|
286
|
+
originalData: {
|
|
287
|
+
results: [{ 'id': 1, 'someData': false, 'test': 'wibble' }, { 'id': 2, 'someData': true, 'test': 'wobble' }],
|
|
288
|
+
totalRecords: 2
|
|
289
|
+
},
|
|
290
|
+
transformed: true,
|
|
291
|
+
},
|
|
292
|
+
'extraProp': 'extraProp'
|
|
293
|
+
},
|
|
294
|
+
queryParams: '?match=test.test1.test2&match=test3&term=test&stats=true&page=1'
|
|
295
|
+
},
|
|
296
|
+
expectedNumberOfResults: 0
|
|
297
|
+
},
|
|
298
|
+
])('$testLabel', ({
|
|
299
|
+
props,
|
|
300
|
+
startingLocation = '/wibble',
|
|
301
|
+
expectQueryFire = true,
|
|
302
|
+
expectedQueryNamespace = getBaseExpectedQueryNamespace(baseSASQObj),
|
|
303
|
+
expectedMockKyCall = '/wibble?match=test.test1.test2&match=test3&term=some%20test%20query&stats=true&page=1',
|
|
304
|
+
expectedMockKyCallAfterSearch = '/wibble?match=test.test1.test2&match=test3&term=some%20test%20query&stats=true&page=1',
|
|
305
|
+
expectedFilterComponent,
|
|
306
|
+
expectedFilterHeaderComponent,
|
|
307
|
+
expectedFilterPane = true,
|
|
308
|
+
expectedBodyComponent,
|
|
309
|
+
expectedNumberOfResults = 2,
|
|
310
|
+
expectedSearchField = true,
|
|
311
|
+
expectedSearchKeyControl = false,
|
|
312
|
+
expectedRef,
|
|
313
|
+
}) => {
|
|
314
|
+
beforeEach(() => {
|
|
315
|
+
// CLEAR MOCKS
|
|
316
|
+
mockKy.mockClear();
|
|
317
|
+
useQuery.mockClear();
|
|
318
|
+
|
|
319
|
+
// CLEAR LOCAL STORAGE to ensure filter pane starts open
|
|
320
|
+
window.localStorage.clear();
|
|
321
|
+
|
|
322
|
+
// SET UP REF
|
|
323
|
+
theRef = createRef();
|
|
324
|
+
renderComponent = renderWithKintHarness(
|
|
325
|
+
<MemoryRouter initialEntries={[startingLocation]}>
|
|
326
|
+
<SASQLookupComponent ref={theRef} {...props}>
|
|
327
|
+
<div>CHILD COMPONENT</div>
|
|
328
|
+
</SASQLookupComponent>
|
|
329
|
+
</MemoryRouter>,
|
|
330
|
+
undefined,
|
|
331
|
+
translationsProperties
|
|
332
|
+
);
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
test('renders children', () => {
|
|
336
|
+
const { getByText } = renderComponent;
|
|
337
|
+
expect(getByText('CHILD COMPONENT')).toBeInTheDocument();
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
test('renders the main pane', async () => {
|
|
341
|
+
await Pane({ id: `${props.id}-main-pane` }).exists();
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
// This MUST happen before the Searching block as that will clear the mocks
|
|
345
|
+
describe('Initial lookup', () => {
|
|
346
|
+
// Called once without SASQ props, then once without page, then finally as expected, so call 2
|
|
347
|
+
test('useQuery namespace was as expected', () => {
|
|
348
|
+
expect(useQuery.mock.calls[3][0]).toEqual(expectedQueryNamespace);
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
if (expectQueryFire) {
|
|
352
|
+
test('mockKy was called with expected values', () => {
|
|
353
|
+
expect(mockKy).toHaveBeenCalledWith(expectedMockKyCall);
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
test('ref has gained lookup data', async () => {
|
|
357
|
+
await waitFor(() => {
|
|
358
|
+
expect(theRef.current).toEqual(expectedRef);
|
|
359
|
+
});
|
|
360
|
+
});
|
|
361
|
+
} else {
|
|
362
|
+
test('mockKy was not called', () => {
|
|
363
|
+
expect(mockKy).toHaveBeenCalledTimes(0);
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
describe('Searching', () => {
|
|
369
|
+
if (expectedSearchKeyControl) {
|
|
370
|
+
test('renders SearchKeyControl', () => {
|
|
371
|
+
const { getByText } = renderComponent;
|
|
372
|
+
expect(getByText('SearchKeyControl')).toBeInTheDocument();
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
if (!expectedSearchField) {
|
|
377
|
+
test('does not render SearchField', async () => {
|
|
378
|
+
await SearchField().absent();
|
|
379
|
+
});
|
|
380
|
+
} else {
|
|
381
|
+
test('renders SearchField', async () => {
|
|
382
|
+
await SearchField().exists();
|
|
383
|
+
});
|
|
384
|
+
|
|
385
|
+
test('mockKy has not yet been called with expected search', async () => {
|
|
386
|
+
await waitFor(() => {
|
|
387
|
+
expect(mockKy).not.toHaveBeenCalledWith(expectedMockKyCallAfterSearch);
|
|
388
|
+
});
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
describe('running a search', () => {
|
|
392
|
+
beforeEach(async () => {
|
|
393
|
+
mockKy.mockClear();
|
|
394
|
+
await waitFor(async () => {
|
|
395
|
+
await SearchField().fillIn('some test query');
|
|
396
|
+
await Button('Search').click();
|
|
397
|
+
});
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
test('mockKy behaves as expected after search', async () => {
|
|
401
|
+
await waitFor(() => {
|
|
402
|
+
expect(mockKy).toHaveBeenCalledWith(expectedMockKyCallAfterSearch);
|
|
403
|
+
});
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
describe('resetting search', () => {
|
|
407
|
+
beforeEach(async () => {
|
|
408
|
+
mockKy.mockClear();
|
|
409
|
+
await waitFor(async () => {
|
|
410
|
+
await Button('Reset all').click();
|
|
411
|
+
});
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
if (expectQueryFire) {
|
|
415
|
+
test('mockKy was called with expected values after reset', async () => {
|
|
416
|
+
await waitFor(() => {
|
|
417
|
+
expect(mockKy).toHaveBeenCalledWith(expectedMockKyCall);
|
|
418
|
+
});
|
|
419
|
+
});
|
|
420
|
+
} else {
|
|
421
|
+
test('mockKy was not called after reset', () => {
|
|
422
|
+
expect(mockKy).toHaveBeenCalledTimes(0);
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
|
|
430
|
+
// TESTING TOTAL RECORDS DISPLAY
|
|
431
|
+
test('displays the correct number of found values', async () => {
|
|
432
|
+
// SASQ uses paneSub for "found X values"
|
|
433
|
+
await Pane({ subtitle: `Found ${expectedNumberOfResults} values` }).exists();
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
if (expectedBodyComponent) {
|
|
437
|
+
test('renders the RenderBody', () => {
|
|
438
|
+
const { getByText } = renderComponent;
|
|
439
|
+
expect(getByText(expectedBodyComponent)).toBeInTheDocument();
|
|
440
|
+
});
|
|
441
|
+
} else {
|
|
442
|
+
test('renders the TableBody', () => {
|
|
443
|
+
const { getByText } = renderComponent;
|
|
444
|
+
expect(getByText('TableBody')).toBeInTheDocument();
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
if (expectedFilterPane) {
|
|
449
|
+
describe('Filter pane', () => {
|
|
450
|
+
test('renders the filter pane', async () => {
|
|
451
|
+
await Pane({ id: `${props.id}-filter-pane` }).exists();
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
test('collapse filter pane button exists', async () => {
|
|
455
|
+
await IconButton('caret-left').exists();
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
test('expand filter pane button does not exist', async () => {
|
|
459
|
+
await IconButton('caret-right').absent();
|
|
460
|
+
});
|
|
461
|
+
|
|
462
|
+
describe('toggling the filter pane', () => {
|
|
463
|
+
beforeEach(async () => {
|
|
464
|
+
// Find the collapse button in the filter pane
|
|
465
|
+
await waitFor(async () => {
|
|
466
|
+
await IconButton('caret-left').click();
|
|
467
|
+
});
|
|
468
|
+
});
|
|
469
|
+
|
|
470
|
+
test('expand button appears in main pane', async () => {
|
|
471
|
+
await IconButton('caret-right').exists();
|
|
472
|
+
});
|
|
473
|
+
|
|
474
|
+
test('filter pane is removed from DOM', async () => {
|
|
475
|
+
await Pane({ id: `${props.id}-filter-pane` }).absent();
|
|
476
|
+
});
|
|
477
|
+
});
|
|
478
|
+
|
|
479
|
+
if (expectedFilterComponent) {
|
|
480
|
+
test('FilterComponent renders', () => {
|
|
481
|
+
const { getByText } = renderComponent;
|
|
482
|
+
expect(getByText(expectedFilterComponent)).toBeInTheDocument();
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
if (expectedFilterHeaderComponent) {
|
|
487
|
+
test('FilterHeaderComponent renders', () => {
|
|
488
|
+
const { getByText } = renderComponent;
|
|
489
|
+
expect(getByText(expectedFilterHeaderComponent)).toBeInTheDocument();
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
});
|
|
@@ -51,7 +51,7 @@ const TableBody = ({
|
|
|
51
51
|
const getRowUrl = useCallback((rowData) => {
|
|
52
52
|
const baseUrl = `${path}/${getNavigationIdentifier(rowData)}`;
|
|
53
53
|
return {
|
|
54
|
-
url: `${baseUrl}${location?.search}`,
|
|
54
|
+
url: `${baseUrl}${location?.search ?? ''}`,
|
|
55
55
|
path,
|
|
56
56
|
baseUrl,
|
|
57
57
|
location
|
|
@@ -61,9 +61,12 @@ const TableBody = ({
|
|
|
61
61
|
const getEnhancedFormatter = useCallback(() => {
|
|
62
62
|
const enhancedFormatter = {};
|
|
63
63
|
for (const [key, value] of Object.entries(formatter)) {
|
|
64
|
-
|
|
64
|
+
if (typeof value === 'function') {
|
|
65
|
+
enhancedFormatter[key] = (item) => value({ ...item, defaultRowUrl: getRowUrl(item) });
|
|
66
|
+
} else {
|
|
67
|
+
enhancedFormatter[key] = value;
|
|
68
|
+
}
|
|
65
69
|
}
|
|
66
|
-
|
|
67
70
|
return enhancedFormatter;
|
|
68
71
|
}, [formatter, getRowUrl]);
|
|
69
72
|
|