@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
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [5.31.4](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.31.3...v5.31.4) (2026-02-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **dependencies:** Lock downshift to 9.0.13 to bring in line with fixes made to Stripes ([685233f](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/commit/685233fb61e33c5139d916590e3745dfce5c9bb5))
|
|
7
|
+
* **Settings:** useSettings "render" not triggering ([8b07c73](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/commit/8b07c73f3f3fb1699ac8a984b3050a6fc35b669e))
|
|
8
|
+
|
|
1
9
|
## [5.31.3](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.31.2...v5.31.3) (2026-01-19)
|
|
2
10
|
|
|
3
11
|
|
|
@@ -89,7 +89,7 @@ const CustomPropertiesViewCtx = _ref => {
|
|
|
89
89
|
return (cp[0]?.type?.ctx === ctx || ctx === 'isNull' && !cp[0]?.type?.ctx) &&
|
|
90
90
|
// Either the ctx string matches, or isNull matches blank
|
|
91
91
|
cp[0]?.type?.primary === primary // Only count non-primary set custprops
|
|
92
|
-
|
|
92
|
+
;
|
|
93
93
|
})?.length ?? 0;
|
|
94
94
|
|
|
95
95
|
// We need to display any set properties, along with any non-set primary properties
|
|
@@ -0,0 +1,540 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _react = require("react");
|
|
4
|
+
var _reactRouterDom = require("react-router-dom");
|
|
5
|
+
var _react2 = require("@folio/jest-config-stripes/testing-library/react");
|
|
6
|
+
var _core = require("@folio/stripes/core");
|
|
7
|
+
var _components = require("@folio/stripes/components");
|
|
8
|
+
var _stripesErmTesting = require("@folio/stripes-erm-testing");
|
|
9
|
+
var _reactQuery = require("react-query");
|
|
10
|
+
var _jest = require("../../../test/jest");
|
|
11
|
+
var _SASQLookupComponent = _interopRequireDefault(require("./SASQLookupComponent"));
|
|
12
|
+
var _helpers = _interopRequireDefault(require("../../../test/helpers"));
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
jest.mock('react-query', () => {
|
|
16
|
+
const {
|
|
17
|
+
mockReactQuery
|
|
18
|
+
} = jest.requireActual('@folio/stripes-erm-testing');
|
|
19
|
+
return {
|
|
20
|
+
...jest.requireActual('react-query'),
|
|
21
|
+
...mockReactQuery,
|
|
22
|
+
useQuery: jest.fn((_key, func, opts) => {
|
|
23
|
+
const defaultData = {
|
|
24
|
+
results: [{
|
|
25
|
+
id: 1,
|
|
26
|
+
someData: false,
|
|
27
|
+
test: 'wibble'
|
|
28
|
+
}, {
|
|
29
|
+
id: 2,
|
|
30
|
+
someData: true,
|
|
31
|
+
test: 'wobble'
|
|
32
|
+
}],
|
|
33
|
+
totalRecords: 2
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// Mock ensures the function is called so we can test outcomes
|
|
37
|
+
if (opts.enabled) {
|
|
38
|
+
func();
|
|
39
|
+
}
|
|
40
|
+
if (opts.select) {
|
|
41
|
+
return {
|
|
42
|
+
data: opts.select(defaultData),
|
|
43
|
+
extraProp: 'extraProp'
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
data: defaultData,
|
|
48
|
+
extraProp: 'extraProp'
|
|
49
|
+
};
|
|
50
|
+
})
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// TODO why does unmocking react-router-dom cause module hierarchy issues?
|
|
55
|
+
// EXAMPLE mocking react-router-dom
|
|
56
|
+
const mockHistoryPush = jest.fn();
|
|
57
|
+
const mockHistoryReplace = jest.fn();
|
|
58
|
+
jest.mock('react-router-dom', () => {
|
|
59
|
+
const {
|
|
60
|
+
mockReactRouterDom
|
|
61
|
+
} = jest.requireActual('@folio/stripes-erm-testing');
|
|
62
|
+
const actualReactRouterDom = jest.requireActual('react-router-dom');
|
|
63
|
+
return {
|
|
64
|
+
...actualReactRouterDom,
|
|
65
|
+
...mockReactRouterDom,
|
|
66
|
+
useHistory: jest.fn(() => ({
|
|
67
|
+
push: mockHistoryPush,
|
|
68
|
+
replace: mockHistoryReplace
|
|
69
|
+
})),
|
|
70
|
+
useLocation: actualReactRouterDom.useLocation // Bit ugly... idk why I need to put this back specifically like this instead of just unmocking react-router-dom
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
jest.mock('./TableBody', () => jest.fn(_ref => {
|
|
74
|
+
let {
|
|
75
|
+
mclProps
|
|
76
|
+
} = _ref;
|
|
77
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
78
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
79
|
+
children: "TableBody"
|
|
80
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
81
|
+
onClick: () => mclProps.onNeedMoreData(null, 1),
|
|
82
|
+
children: "Next Page"
|
|
83
|
+
})]
|
|
84
|
+
});
|
|
85
|
+
}));
|
|
86
|
+
jest.mock('../SearchKeyControl', () => jest.fn(() => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
87
|
+
children: "SearchKeyControl"
|
|
88
|
+
})));
|
|
89
|
+
const fetchParameters = {
|
|
90
|
+
endpoint: '/wibble',
|
|
91
|
+
SASQ_MAP: {
|
|
92
|
+
searchKey: 'test.test1.test2,test3',
|
|
93
|
+
filterKeys: {
|
|
94
|
+
status: 'status.value',
|
|
95
|
+
wobble: 'wobble.value'
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const baseSASQLookupProps = {
|
|
100
|
+
id: 'testing-sasq-lookup-component',
|
|
101
|
+
path: 'the-path',
|
|
102
|
+
// Required as it's needed for children
|
|
103
|
+
fetchParameters
|
|
104
|
+
};
|
|
105
|
+
const baseSASQObj = {
|
|
106
|
+
filters: '',
|
|
107
|
+
qindex: undefined,
|
|
108
|
+
query: ''
|
|
109
|
+
};
|
|
110
|
+
const getBaseExpectedQueryNamespace = function () {
|
|
111
|
+
let obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : baseSASQLookupProps;
|
|
112
|
+
return ['@folio/test-implementor', 'SASQ', 'testing-sasq-lookup-component', 'viewAll', obj, 1];
|
|
113
|
+
};
|
|
114
|
+
let renderComponent;
|
|
115
|
+
let theRef;
|
|
116
|
+
describe('SASQLookupComponent', () => {
|
|
117
|
+
describe.each([{
|
|
118
|
+
testLabel: 'default behaviour',
|
|
119
|
+
props: baseSASQLookupProps,
|
|
120
|
+
expectQueryFire: false,
|
|
121
|
+
expectedMockKyCall: '/wibble?filters=status.value%3D%3DtestFilter&stats=true&page=1'
|
|
122
|
+
}, {
|
|
123
|
+
testLabel: 'with searchable indexes',
|
|
124
|
+
props: {
|
|
125
|
+
...baseSASQLookupProps,
|
|
126
|
+
searchableIndexes: [{
|
|
127
|
+
key: 'name',
|
|
128
|
+
label: 'Name'
|
|
129
|
+
}]
|
|
130
|
+
},
|
|
131
|
+
expectQueryFire: false,
|
|
132
|
+
// No actual query yet
|
|
133
|
+
expectedSearchKeyControl: true
|
|
134
|
+
}, {
|
|
135
|
+
testLabel: 'starting with filters',
|
|
136
|
+
props: baseSASQLookupProps,
|
|
137
|
+
startingLocation: '/wibble?filters=status.testFilter',
|
|
138
|
+
expectedQueryNamespace: getBaseExpectedQueryNamespace({
|
|
139
|
+
filters: 'status.testFilter',
|
|
140
|
+
qindex: undefined,
|
|
141
|
+
query: ''
|
|
142
|
+
}),
|
|
143
|
+
expectedMockKyCall: '/wibble?filters=status.value%3D%3DtestFilter&stats=true&page=1',
|
|
144
|
+
expectedMockKyCallAfterSearch: '/wibble?match=test.test1.test2&match=test3&term=some%20test%20query&filters=status.value%3D%3DtestFilter&stats=true&page=1',
|
|
145
|
+
expectedRef: {
|
|
146
|
+
lookupQueryProps: {
|
|
147
|
+
data: {
|
|
148
|
+
results: [{
|
|
149
|
+
'id': 1,
|
|
150
|
+
'someData': false,
|
|
151
|
+
'test': 'wibble'
|
|
152
|
+
}, {
|
|
153
|
+
'id': 2,
|
|
154
|
+
'someData': true,
|
|
155
|
+
'test': 'wobble'
|
|
156
|
+
}],
|
|
157
|
+
totalRecords: 2
|
|
158
|
+
},
|
|
159
|
+
'extraProp': 'extraProp'
|
|
160
|
+
},
|
|
161
|
+
queryParams: '?filters=status.value%3D%3DtestFilter&stats=true&page=1'
|
|
162
|
+
}
|
|
163
|
+
}, {
|
|
164
|
+
testLabel: 'starting with qindex and no query',
|
|
165
|
+
props: baseSASQLookupProps,
|
|
166
|
+
startingLocation: '/wibble?qindex=test.test1.test2',
|
|
167
|
+
expectQueryFire: false,
|
|
168
|
+
expectedQueryNamespace: getBaseExpectedQueryNamespace({
|
|
169
|
+
filters: '',
|
|
170
|
+
qindex: 'test.test1.test2',
|
|
171
|
+
query: ''
|
|
172
|
+
}),
|
|
173
|
+
expectedMockKyCallAfterSearch: '/wibble?match=test.test1.test2&term=some%20test%20query&stats=true&page=1'
|
|
174
|
+
}, {
|
|
175
|
+
testLabel: 'starting with qindex and query',
|
|
176
|
+
props: {
|
|
177
|
+
...baseSASQLookupProps,
|
|
178
|
+
sasqProps: {
|
|
179
|
+
initialSearchState: {
|
|
180
|
+
query: 'hello',
|
|
181
|
+
qindex: 'test.test1.test2'
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
startingLocation: '/wibble?qindex=some.new.qindex.path&query=hello',
|
|
186
|
+
expectedQueryNamespace: getBaseExpectedQueryNamespace({
|
|
187
|
+
filters: '',
|
|
188
|
+
qindex: 'some.new.qindex.path',
|
|
189
|
+
query: 'hello'
|
|
190
|
+
}),
|
|
191
|
+
expectedMockKyCall: '/wibble?match=some.new.qindex.path&term=hello&stats=true&page=1',
|
|
192
|
+
expectedMockKyCallAfterSearch: '/wibble?match=some.new.qindex.path&term=some%20test%20query&stats=true&page=1',
|
|
193
|
+
expectedRef: {
|
|
194
|
+
lookupQueryProps: {
|
|
195
|
+
data: {
|
|
196
|
+
results: [{
|
|
197
|
+
'id': 1,
|
|
198
|
+
'someData': false,
|
|
199
|
+
'test': 'wibble'
|
|
200
|
+
}, {
|
|
201
|
+
'id': 2,
|
|
202
|
+
'someData': true,
|
|
203
|
+
'test': 'wobble'
|
|
204
|
+
}],
|
|
205
|
+
totalRecords: 2
|
|
206
|
+
},
|
|
207
|
+
'extraProp': 'extraProp'
|
|
208
|
+
},
|
|
209
|
+
queryParams: '?match=some.new.qindex.path&term=hello&stats=true&page=1'
|
|
210
|
+
}
|
|
211
|
+
}, {
|
|
212
|
+
testLabel: 'with FilterComponent',
|
|
213
|
+
props: {
|
|
214
|
+
...baseSASQLookupProps,
|
|
215
|
+
FilterComponent: () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
216
|
+
children: "FilterComponent"
|
|
217
|
+
})
|
|
218
|
+
},
|
|
219
|
+
expectQueryFire: false,
|
|
220
|
+
expectedMockKyCall: '/wibble?filters=status.value%3D%3DtestFilter&stats=true&page=1',
|
|
221
|
+
expectedFilterComponent: 'FilterComponent'
|
|
222
|
+
}, {
|
|
223
|
+
testLabel: 'with filter pane disabled',
|
|
224
|
+
props: {
|
|
225
|
+
...baseSASQLookupProps,
|
|
226
|
+
hasFilterPane: false
|
|
227
|
+
},
|
|
228
|
+
expectQueryFire: false,
|
|
229
|
+
expectedSearchField: false,
|
|
230
|
+
expectedFilterPane: false
|
|
231
|
+
}, {
|
|
232
|
+
testLabel: 'with FilterHeaderComponent',
|
|
233
|
+
props: {
|
|
234
|
+
...baseSASQLookupProps,
|
|
235
|
+
FilterPaneHeaderComponent: () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
236
|
+
children: "FilterPaneHeaderComponent"
|
|
237
|
+
})
|
|
238
|
+
},
|
|
239
|
+
expectQueryFire: false,
|
|
240
|
+
expectedMockKyCall: '/wibble?filters=status.value%3D%3DtestFilter&stats=true&page=1',
|
|
241
|
+
expectedFilterHeaderComponent: 'FilterPaneHeaderComponent'
|
|
242
|
+
}, {
|
|
243
|
+
testLabel: 'no search field mode',
|
|
244
|
+
props: {
|
|
245
|
+
...baseSASQLookupProps,
|
|
246
|
+
noSearchField: true
|
|
247
|
+
},
|
|
248
|
+
expectQueryFire: false,
|
|
249
|
+
expectedSearchField: false
|
|
250
|
+
}, {
|
|
251
|
+
testLabel: 'with RenderBody',
|
|
252
|
+
props: {
|
|
253
|
+
...baseSASQLookupProps,
|
|
254
|
+
RenderBody: () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
255
|
+
children: "TheBodyComponent"
|
|
256
|
+
})
|
|
257
|
+
},
|
|
258
|
+
expectQueryFire: false,
|
|
259
|
+
expectedMockKyCall: '/wibble?filters=status.value%3D%3DtestFilter&stats=true&page=1',
|
|
260
|
+
expectedBodyComponent: 'TheBodyComponent'
|
|
261
|
+
}, {
|
|
262
|
+
testLabel: 'with custom lookupQueryNamespaceGenerator',
|
|
263
|
+
props: {
|
|
264
|
+
...baseSASQLookupProps,
|
|
265
|
+
lookupQueryNamespaceGenerator: _ref2 => {
|
|
266
|
+
let {
|
|
267
|
+
currentPage,
|
|
268
|
+
namespace,
|
|
269
|
+
id: passedId
|
|
270
|
+
} = _ref2;
|
|
271
|
+
return [`testing-${currentPage}`, `testing-${namespace}`, `testing-${passedId}`];
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
expectedQueryNamespace: ['testing-1', 'testing-@folio/test-implementor', 'testing-testing-sasq-lookup-component'],
|
|
275
|
+
startingLocation: '/wibble?filters=status.testFilter',
|
|
276
|
+
expectedMockKyCall: '/wibble?filters=status.value%3D%3DtestFilter&stats=true&page=1',
|
|
277
|
+
expectedMockKyCallAfterSearch: '/wibble?match=test.test1.test2&match=test3&term=some%20test%20query&filters=status.value%3D%3DtestFilter&stats=true&page=1',
|
|
278
|
+
expectedRef: {
|
|
279
|
+
lookupQueryProps: {
|
|
280
|
+
data: {
|
|
281
|
+
results: [{
|
|
282
|
+
'id': 1,
|
|
283
|
+
'someData': false,
|
|
284
|
+
'test': 'wibble'
|
|
285
|
+
}, {
|
|
286
|
+
'id': 2,
|
|
287
|
+
'someData': true,
|
|
288
|
+
'test': 'wobble'
|
|
289
|
+
}],
|
|
290
|
+
totalRecords: 2
|
|
291
|
+
},
|
|
292
|
+
'extraProp': 'extraProp'
|
|
293
|
+
},
|
|
294
|
+
queryParams: '?filters=status.value%3D%3DtestFilter&stats=true&page=1'
|
|
295
|
+
}
|
|
296
|
+
}, {
|
|
297
|
+
testLabel: 'with lookupResponseTransform',
|
|
298
|
+
props: {
|
|
299
|
+
...baseSASQLookupProps,
|
|
300
|
+
sasqProps: {
|
|
301
|
+
initialSearchState: {
|
|
302
|
+
query: 'test',
|
|
303
|
+
qindex: 'test.test1.test2'
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
// Wrap results in an extra object to prove transform works
|
|
307
|
+
lookupResponseTransform: resp => ({
|
|
308
|
+
originalData: resp,
|
|
309
|
+
transformed: true
|
|
310
|
+
})
|
|
311
|
+
},
|
|
312
|
+
startingLocation: '/wibble?query=test',
|
|
313
|
+
expectedQueryNamespace: getBaseExpectedQueryNamespace({
|
|
314
|
+
filters: '',
|
|
315
|
+
qindex: undefined,
|
|
316
|
+
query: 'test'
|
|
317
|
+
}),
|
|
318
|
+
expectedMockKyCall: '/wibble?match=test.test1.test2&match=test3&term=test&stats=true&page=1',
|
|
319
|
+
expectedRef: {
|
|
320
|
+
lookupQueryProps: {
|
|
321
|
+
data: {
|
|
322
|
+
originalData: {
|
|
323
|
+
results: [{
|
|
324
|
+
'id': 1,
|
|
325
|
+
'someData': false,
|
|
326
|
+
'test': 'wibble'
|
|
327
|
+
}, {
|
|
328
|
+
'id': 2,
|
|
329
|
+
'someData': true,
|
|
330
|
+
'test': 'wobble'
|
|
331
|
+
}],
|
|
332
|
+
totalRecords: 2
|
|
333
|
+
},
|
|
334
|
+
transformed: true
|
|
335
|
+
},
|
|
336
|
+
'extraProp': 'extraProp'
|
|
337
|
+
},
|
|
338
|
+
queryParams: '?match=test.test1.test2&match=test3&term=test&stats=true&page=1'
|
|
339
|
+
},
|
|
340
|
+
expectedNumberOfResults: 0
|
|
341
|
+
}])('$testLabel', _ref3 => {
|
|
342
|
+
let {
|
|
343
|
+
props,
|
|
344
|
+
startingLocation = '/wibble',
|
|
345
|
+
expectQueryFire = true,
|
|
346
|
+
expectedQueryNamespace = getBaseExpectedQueryNamespace(baseSASQObj),
|
|
347
|
+
expectedMockKyCall = '/wibble?match=test.test1.test2&match=test3&term=some%20test%20query&stats=true&page=1',
|
|
348
|
+
expectedMockKyCallAfterSearch = '/wibble?match=test.test1.test2&match=test3&term=some%20test%20query&stats=true&page=1',
|
|
349
|
+
expectedFilterComponent,
|
|
350
|
+
expectedFilterHeaderComponent,
|
|
351
|
+
expectedFilterPane = true,
|
|
352
|
+
expectedBodyComponent,
|
|
353
|
+
expectedNumberOfResults = 2,
|
|
354
|
+
expectedSearchField = true,
|
|
355
|
+
expectedSearchKeyControl = false,
|
|
356
|
+
expectedRef
|
|
357
|
+
} = _ref3;
|
|
358
|
+
beforeEach(() => {
|
|
359
|
+
// CLEAR MOCKS
|
|
360
|
+
_core.mockKy.mockClear();
|
|
361
|
+
_reactQuery.useQuery.mockClear();
|
|
362
|
+
|
|
363
|
+
// CLEAR LOCAL STORAGE to ensure filter pane starts open
|
|
364
|
+
window.localStorage.clear();
|
|
365
|
+
|
|
366
|
+
// SET UP REF
|
|
367
|
+
theRef = /*#__PURE__*/(0, _react.createRef)();
|
|
368
|
+
renderComponent = (0, _jest.renderWithKintHarness)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
|
|
369
|
+
initialEntries: [startingLocation],
|
|
370
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SASQLookupComponent.default, {
|
|
371
|
+
ref: theRef,
|
|
372
|
+
...props,
|
|
373
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
374
|
+
children: "CHILD COMPONENT"
|
|
375
|
+
})
|
|
376
|
+
})
|
|
377
|
+
}), undefined, _helpers.default);
|
|
378
|
+
});
|
|
379
|
+
test('renders children', () => {
|
|
380
|
+
const {
|
|
381
|
+
getByText
|
|
382
|
+
} = renderComponent;
|
|
383
|
+
expect(getByText('CHILD COMPONENT')).toBeInTheDocument();
|
|
384
|
+
});
|
|
385
|
+
test('renders the main pane', async () => {
|
|
386
|
+
await (0, _stripesErmTesting.Pane)({
|
|
387
|
+
id: `${props.id}-main-pane`
|
|
388
|
+
}).exists();
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
// This MUST happen before the Searching block as that will clear the mocks
|
|
392
|
+
describe('Initial lookup', () => {
|
|
393
|
+
// Called once without SASQ props, then once without page, then finally as expected, so call 2
|
|
394
|
+
test('useQuery namespace was as expected', () => {
|
|
395
|
+
expect(_reactQuery.useQuery.mock.calls[3][0]).toEqual(expectedQueryNamespace);
|
|
396
|
+
});
|
|
397
|
+
if (expectQueryFire) {
|
|
398
|
+
test('mockKy was called with expected values', () => {
|
|
399
|
+
expect(_core.mockKy).toHaveBeenCalledWith(expectedMockKyCall);
|
|
400
|
+
});
|
|
401
|
+
test('ref has gained lookup data', async () => {
|
|
402
|
+
await (0, _react2.waitFor)(() => {
|
|
403
|
+
expect(theRef.current).toEqual(expectedRef);
|
|
404
|
+
});
|
|
405
|
+
});
|
|
406
|
+
} else {
|
|
407
|
+
test('mockKy was not called', () => {
|
|
408
|
+
expect(_core.mockKy).toHaveBeenCalledTimes(0);
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
describe('Searching', () => {
|
|
413
|
+
if (expectedSearchKeyControl) {
|
|
414
|
+
test('renders SearchKeyControl', () => {
|
|
415
|
+
const {
|
|
416
|
+
getByText
|
|
417
|
+
} = renderComponent;
|
|
418
|
+
expect(getByText('SearchKeyControl')).toBeInTheDocument();
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
if (!expectedSearchField) {
|
|
422
|
+
test('does not render SearchField', async () => {
|
|
423
|
+
await (0, _stripesErmTesting.SearchField)().absent();
|
|
424
|
+
});
|
|
425
|
+
} else {
|
|
426
|
+
test('renders SearchField', async () => {
|
|
427
|
+
await (0, _stripesErmTesting.SearchField)().exists();
|
|
428
|
+
});
|
|
429
|
+
test('mockKy has not yet been called with expected search', async () => {
|
|
430
|
+
await (0, _react2.waitFor)(() => {
|
|
431
|
+
expect(_core.mockKy).not.toHaveBeenCalledWith(expectedMockKyCallAfterSearch);
|
|
432
|
+
});
|
|
433
|
+
});
|
|
434
|
+
describe('running a search', () => {
|
|
435
|
+
beforeEach(async () => {
|
|
436
|
+
_core.mockKy.mockClear();
|
|
437
|
+
await (0, _react2.waitFor)(async () => {
|
|
438
|
+
await (0, _stripesErmTesting.SearchField)().fillIn('some test query');
|
|
439
|
+
await (0, _stripesErmTesting.Button)('Search').click();
|
|
440
|
+
});
|
|
441
|
+
});
|
|
442
|
+
test('mockKy behaves as expected after search', async () => {
|
|
443
|
+
await (0, _react2.waitFor)(() => {
|
|
444
|
+
expect(_core.mockKy).toHaveBeenCalledWith(expectedMockKyCallAfterSearch);
|
|
445
|
+
});
|
|
446
|
+
});
|
|
447
|
+
describe('resetting search', () => {
|
|
448
|
+
beforeEach(async () => {
|
|
449
|
+
_core.mockKy.mockClear();
|
|
450
|
+
await (0, _react2.waitFor)(async () => {
|
|
451
|
+
await (0, _stripesErmTesting.Button)('Reset all').click();
|
|
452
|
+
});
|
|
453
|
+
});
|
|
454
|
+
if (expectQueryFire) {
|
|
455
|
+
test('mockKy was called with expected values after reset', async () => {
|
|
456
|
+
await (0, _react2.waitFor)(() => {
|
|
457
|
+
expect(_core.mockKy).toHaveBeenCalledWith(expectedMockKyCall);
|
|
458
|
+
});
|
|
459
|
+
});
|
|
460
|
+
} else {
|
|
461
|
+
test('mockKy was not called after reset', () => {
|
|
462
|
+
expect(_core.mockKy).toHaveBeenCalledTimes(0);
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
});
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
});
|
|
469
|
+
|
|
470
|
+
// TESTING TOTAL RECORDS DISPLAY
|
|
471
|
+
test('displays the correct number of found values', async () => {
|
|
472
|
+
// SASQ uses paneSub for "found X values"
|
|
473
|
+
await (0, _stripesErmTesting.Pane)({
|
|
474
|
+
subtitle: `Found ${expectedNumberOfResults} values`
|
|
475
|
+
}).exists();
|
|
476
|
+
});
|
|
477
|
+
if (expectedBodyComponent) {
|
|
478
|
+
test('renders the RenderBody', () => {
|
|
479
|
+
const {
|
|
480
|
+
getByText
|
|
481
|
+
} = renderComponent;
|
|
482
|
+
expect(getByText(expectedBodyComponent)).toBeInTheDocument();
|
|
483
|
+
});
|
|
484
|
+
} else {
|
|
485
|
+
test('renders the TableBody', () => {
|
|
486
|
+
const {
|
|
487
|
+
getByText
|
|
488
|
+
} = renderComponent;
|
|
489
|
+
expect(getByText('TableBody')).toBeInTheDocument();
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
if (expectedFilterPane) {
|
|
493
|
+
describe('Filter pane', () => {
|
|
494
|
+
test('renders the filter pane', async () => {
|
|
495
|
+
await (0, _stripesErmTesting.Pane)({
|
|
496
|
+
id: `${props.id}-filter-pane`
|
|
497
|
+
}).exists();
|
|
498
|
+
});
|
|
499
|
+
test('collapse filter pane button exists', async () => {
|
|
500
|
+
await (0, _stripesErmTesting.IconButton)('caret-left').exists();
|
|
501
|
+
});
|
|
502
|
+
test('expand filter pane button does not exist', async () => {
|
|
503
|
+
await (0, _stripesErmTesting.IconButton)('caret-right').absent();
|
|
504
|
+
});
|
|
505
|
+
describe('toggling the filter pane', () => {
|
|
506
|
+
beforeEach(async () => {
|
|
507
|
+
// Find the collapse button in the filter pane
|
|
508
|
+
await (0, _react2.waitFor)(async () => {
|
|
509
|
+
await (0, _stripesErmTesting.IconButton)('caret-left').click();
|
|
510
|
+
});
|
|
511
|
+
});
|
|
512
|
+
test('expand button appears in main pane', async () => {
|
|
513
|
+
await (0, _stripesErmTesting.IconButton)('caret-right').exists();
|
|
514
|
+
});
|
|
515
|
+
test('filter pane is removed from DOM', async () => {
|
|
516
|
+
await (0, _stripesErmTesting.Pane)({
|
|
517
|
+
id: `${props.id}-filter-pane`
|
|
518
|
+
}).absent();
|
|
519
|
+
});
|
|
520
|
+
});
|
|
521
|
+
if (expectedFilterComponent) {
|
|
522
|
+
test('FilterComponent renders', () => {
|
|
523
|
+
const {
|
|
524
|
+
getByText
|
|
525
|
+
} = renderComponent;
|
|
526
|
+
expect(getByText(expectedFilterComponent)).toBeInTheDocument();
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
if (expectedFilterHeaderComponent) {
|
|
530
|
+
test('FilterHeaderComponent renders', () => {
|
|
531
|
+
const {
|
|
532
|
+
getByText
|
|
533
|
+
} = renderComponent;
|
|
534
|
+
expect(getByText(expectedFilterHeaderComponent)).toBeInTheDocument();
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
});
|
|
540
|
+
});
|
|
@@ -54,7 +54,7 @@ const TableBody = _ref => {
|
|
|
54
54
|
const getRowUrl = (0, _react.useCallback)(rowData => {
|
|
55
55
|
const baseUrl = `${path}/${getNavigationIdentifier(rowData)}`;
|
|
56
56
|
return {
|
|
57
|
-
url: `${baseUrl}${location?.search}`,
|
|
57
|
+
url: `${baseUrl}${location?.search ?? ''}`,
|
|
58
58
|
path,
|
|
59
59
|
baseUrl,
|
|
60
60
|
location
|
|
@@ -63,10 +63,14 @@ const TableBody = _ref => {
|
|
|
63
63
|
const getEnhancedFormatter = (0, _react.useCallback)(() => {
|
|
64
64
|
const enhancedFormatter = {};
|
|
65
65
|
for (const [key, value] of Object.entries(formatter)) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
if (typeof value === 'function') {
|
|
67
|
+
enhancedFormatter[key] = item => value({
|
|
68
|
+
...item,
|
|
69
|
+
defaultRowUrl: getRowUrl(item)
|
|
70
|
+
});
|
|
71
|
+
} else {
|
|
72
|
+
enhancedFormatter[key] = value;
|
|
73
|
+
}
|
|
70
74
|
}
|
|
71
75
|
return enhancedFormatter;
|
|
72
76
|
}, [formatter, getRowUrl]);
|