@axinom/mosaic-ui 0.69.0-rc.2 → 0.69.0-rc.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Buttons/Button/Button.d.ts +3 -3
- package/dist/components/Buttons/Button/Button.d.ts.map +1 -1
- package/dist/components/Buttons/Button.model.d.ts +2 -1
- package/dist/components/Buttons/Button.model.d.ts.map +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.models.d.ts +0 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.models.d.ts.map +1 -1
- package/dist/components/DateTime/TimePicker/ScrollColumn/ScrollColumn.d.ts +2 -2
- package/dist/components/DateTime/TimePicker/ScrollColumn/ScrollColumn.d.ts.map +1 -1
- package/dist/components/DynamicDataList/DynamicDataList.d.ts +1 -1
- package/dist/components/DynamicDataList/DynamicDataList.d.ts.map +1 -1
- package/dist/components/DynamicDataList/DynamicDataList.model.d.ts +0 -1
- package/dist/components/DynamicDataList/DynamicDataList.model.d.ts.map +1 -1
- package/dist/components/DynamicDataList/DynamicListDataEntry/DynamicListDataEntry.d.ts +2 -2
- package/dist/components/DynamicDataList/DynamicListDataEntry/DynamicListDataEntry.d.ts.map +1 -1
- package/dist/components/DynamicDataList/DynamicListDataEntry/Renderers/createInputRenderer/createInputRenderer.d.ts +1 -1
- package/dist/components/DynamicDataList/DynamicListDataEntry/Renderers/createInputRenderer/createInputRenderer.d.ts.map +1 -1
- package/dist/components/DynamicDataList/DynamicListDataEntry/Renderers/createSelectRenderer/createSelectRenderer.d.ts +1 -1
- package/dist/components/DynamicDataList/DynamicListDataEntry/Renderers/createSelectRenderer/createSelectRenderer.d.ts.map +1 -1
- package/dist/components/DynamicDataList/DynamicListDataEntry/Renderers/renderers.model.d.ts +2 -0
- package/dist/components/DynamicDataList/DynamicListDataEntry/Renderers/renderers.model.d.ts.map +1 -1
- package/dist/components/DynamicDataList/DynamicListHeader/DynamicListHeader.d.ts +2 -2
- package/dist/components/DynamicDataList/DynamicListHeader/DynamicListHeader.d.ts.map +1 -1
- package/dist/components/DynamicDataList/DynamicListRow/DynamicListRow.d.ts +2 -2
- package/dist/components/DynamicDataList/DynamicListRow/DynamicListRow.d.ts.map +1 -1
- package/dist/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.actions.d.ts +2 -2
- package/dist/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.actions.d.ts.map +1 -1
- package/dist/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.d.ts.map +1 -1
- package/dist/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.init.d.ts.map +1 -1
- package/dist/components/DynamicDataList/helpers/useColumnDefs.d.ts +1 -1
- package/dist/components/DynamicDataList/helpers/useColumnDefs.d.ts.map +1 -1
- package/dist/components/DynamicDataList/helpers/useDataHandler.d.ts +1 -1
- package/dist/components/DynamicDataList/helpers/useDataHandler.d.ts.map +1 -1
- package/dist/components/DynamicDataList/helpers/useRowAnimation.d.ts.map +1 -1
- package/dist/components/DynamicDataList/helpers/useRowEditing.d.ts.map +1 -1
- package/dist/components/EmptyStation/EmptyStation.d.ts.map +1 -1
- package/dist/components/Explorer/BulkEdit/FormFieldsConfigConverter.d.ts.map +1 -1
- package/dist/components/Explorer/BulkEdit/GenerateMutation.d.ts.map +1 -1
- package/dist/components/Explorer/BulkEdit/helpers/FieldWrapper.d.ts.map +1 -1
- package/dist/components/Explorer/BulkEdit/useBulkEdit.d.ts.map +1 -1
- package/dist/components/Explorer/Explorer.d.ts +1 -1
- package/dist/components/Explorer/Explorer.d.ts.map +1 -1
- package/dist/components/Explorer/Explorer.model.d.ts +0 -1
- package/dist/components/Explorer/Explorer.model.d.ts.map +1 -1
- package/dist/components/Explorer/NavigationExplorer/NavigationExplorer.d.ts +1 -1
- package/dist/components/Explorer/NavigationExplorer/NavigationExplorer.d.ts.map +1 -1
- package/dist/components/Explorer/QuickEdit/useQuickEdit.d.ts.map +1 -1
- package/dist/components/Explorer/SelectionExplorer/SelectionExplorer.d.ts +1 -1
- package/dist/components/Explorer/SelectionExplorer/SelectionExplorer.d.ts.map +1 -1
- package/dist/components/Explorer/helpers/useActions.d.ts +0 -1
- package/dist/components/Explorer/helpers/useActions.d.ts.map +1 -1
- package/dist/components/Explorer/helpers/useDataProvider.d.ts +0 -1
- package/dist/components/Explorer/helpers/useDataProvider.d.ts.map +1 -1
- package/dist/components/Explorer/helpers/useFilters.d.ts +0 -1
- package/dist/components/Explorer/helpers/useFilters.d.ts.map +1 -1
- package/dist/components/FieldSelection/FieldSelection.d.ts +1 -0
- package/dist/components/FieldSelection/FieldSelection.d.ts.map +1 -1
- package/dist/components/Filters/Filter/Filter.d.ts +2 -2
- package/dist/components/Filters/Filter/Filter.d.ts.map +1 -1
- package/dist/components/Filters/Filters.d.ts +2 -2
- package/dist/components/Filters/Filters.d.ts.map +1 -1
- package/dist/components/Filters/Filters.model.d.ts +0 -1
- package/dist/components/Filters/Filters.model.d.ts.map +1 -1
- package/dist/components/Filters/Validators/DateRangeFilterValidator.d.ts.map +1 -1
- package/dist/components/Filters/Validators/NumberRangeFilterValidator.d.ts.map +1 -1
- package/dist/components/FormElements/DynamicDataListControl/DynamicDataListControl.d.ts +0 -1
- package/dist/components/FormElements/DynamicDataListControl/DynamicDataListControl.d.ts.map +1 -1
- package/dist/components/FormElements/DynamicDataListControl/DynamicDataListField.d.ts +2 -2
- package/dist/components/FormElements/DynamicDataListControl/DynamicDataListField.d.ts.map +1 -1
- package/dist/components/FormElements/FormGroup/FormGroup.d.ts +12 -0
- package/dist/components/FormElements/FormGroup/FormGroup.d.ts.map +1 -0
- package/dist/components/FormElements/FormGroupTitle/FormGroupTitle.d.ts +5 -0
- package/dist/components/FormElements/FormGroupTitle/FormGroupTitle.d.ts.map +1 -1
- package/dist/components/FormElements/FormikDebug/FormikDebug.d.ts +0 -1
- package/dist/components/FormElements/FormikDebug/FormikDebug.d.ts.map +1 -1
- package/dist/components/FormElements/ReadOnly/ReadOnlyField.d.ts +2 -2
- package/dist/components/FormElements/ReadOnly/ReadOnlyField.d.ts.map +1 -1
- package/dist/components/FormElements/ReadOnlyText/ReadOnlyTextField.d.ts +2 -2
- package/dist/components/FormElements/ReadOnlyText/ReadOnlyTextField.d.ts.map +1 -1
- package/dist/components/FormElements/Tags/Tags.d.ts +2 -2
- package/dist/components/FormElements/Tags/Tags.d.ts.map +1 -1
- package/dist/components/FormElements/Tags/TagsField.d.ts +2 -2
- package/dist/components/FormElements/Tags/TagsField.d.ts.map +1 -1
- package/dist/components/FormElements/formStoryHelper.d.ts.map +1 -1
- package/dist/components/FormElements/index.d.ts +1 -0
- package/dist/components/FormElements/index.d.ts.map +1 -1
- package/dist/components/FormElements/useFormikError.d.ts.map +1 -1
- package/dist/components/FormStation/Create/Create.d.ts +2 -2
- package/dist/components/FormStation/Create/Create.d.ts.map +1 -1
- package/dist/components/FormStation/Details/Details.d.ts +2 -2
- package/dist/components/FormStation/Details/Details.d.ts.map +1 -1
- package/dist/components/FormStation/FormStation.d.ts +2 -2
- package/dist/components/FormStation/FormStation.d.ts.map +1 -1
- package/dist/components/FormStation/FormStationActions/FormStationActions.d.ts +1 -1
- package/dist/components/FormStation/FormStationActions/FormStationActions.d.ts.map +1 -1
- package/dist/components/FormStation/FormStationHeader/FormStationHeader.d.ts.map +1 -1
- package/dist/components/FormStation/SaveOnDemand/SaveOnDemand.d.ts +0 -1
- package/dist/components/FormStation/SaveOnDemand/SaveOnDemand.d.ts.map +1 -1
- package/dist/components/FormStation/SaveOnNavigate/handleNavigationAttempt.d.ts.map +1 -1
- package/dist/components/FormStation/helpers/useTitle.d.ts.map +1 -1
- package/dist/components/InfoPanel/hooks/useCollapse.d.ts +0 -1
- package/dist/components/InfoPanel/hooks/useCollapse.d.ts.map +1 -1
- package/dist/components/InlineMenu/InlineMenu.d.ts.map +1 -1
- package/dist/components/List/List.d.ts +2 -2
- package/dist/components/List/List.d.ts.map +1 -1
- package/dist/components/List/List.model.d.ts +0 -1
- package/dist/components/List/List.model.d.ts.map +1 -1
- package/dist/components/List/List.stories.helper.d.ts.map +1 -1
- package/dist/components/List/ListHeader/ColumnLabel/ColumnLabel.d.ts +2 -2
- package/dist/components/List/ListHeader/ColumnLabel/ColumnLabel.d.ts.map +1 -1
- package/dist/components/List/ListHeader/ListHeader.d.ts +2 -2
- package/dist/components/List/ListHeader/ListHeader.d.ts.map +1 -1
- package/dist/components/List/ListRow/ListRow.d.ts +2 -4
- package/dist/components/List/ListRow/ListRow.d.ts.map +1 -1
- package/dist/components/List/ListRow/ListRowCell/ListRowCell.d.ts +0 -1
- package/dist/components/List/ListRow/ListRowCell/ListRowCell.d.ts.map +1 -1
- package/dist/components/List/ListRow/ListRowCell/renderData.d.ts.map +1 -1
- package/dist/components/List/ListRow/ListRowLoader.d.ts +2 -2
- package/dist/components/List/ListRow/ListRowLoader.d.ts.map +1 -1
- package/dist/components/List/ListRow/Renderers/BooleanDotRenderer/BooleanDotRenderer.d.ts +0 -1
- package/dist/components/List/ListRow/Renderers/BooleanDotRenderer/BooleanDotRenderer.d.ts.map +1 -1
- package/dist/components/List/ListRow/Renderers/DateRenderer/DateRenderer.d.ts.map +1 -1
- package/dist/components/List/ListRow/Renderers/ExternalLinkRenderer/ExternalLinkRenderer.d.ts.map +1 -1
- package/dist/components/List/ListRow/Renderers/StateRenderer/StateRenderer.d.ts +1 -1
- package/dist/components/List/ListRow/Renderers/StateRenderer/StateRenderer.d.ts.map +1 -1
- package/dist/components/List/ListRow/Renderers/TagsRenderer/TagsRenderer.d.ts +0 -1
- package/dist/components/List/ListRow/Renderers/TagsRenderer/TagsRenderer.d.ts.map +1 -1
- package/dist/components/List/ListRow/Renderers/TimestampRenderer/TimestampRenderer.d.ts.map +1 -1
- package/dist/components/List/ListRowRenderer/ListRowRenderer.d.ts.map +1 -1
- package/dist/components/List/helpers.d.ts.map +1 -1
- package/dist/components/List/useColumnsSize.d.ts +0 -2
- package/dist/components/List/useColumnsSize.d.ts.map +1 -1
- package/dist/components/Loaders/skeletons.d.ts +0 -1
- package/dist/components/Loaders/skeletons.d.ts.map +1 -1
- package/dist/components/Modal/useModal.d.ts.map +1 -1
- package/dist/components/PageHeader/PageHeaderActionsGroup/PageHeaderActionsGroupsContext.d.ts +0 -1
- package/dist/components/PageHeader/PageHeaderActionsGroup/PageHeaderActionsGroupsContext.d.ts.map +1 -1
- package/dist/components/PageHeader/helpers/useElementWidthObserver.d.ts +1 -2
- package/dist/components/PageHeader/helpers/useElementWidthObserver.d.ts.map +1 -1
- package/dist/components/Tabs/TabList/ScrollContainer/useScroll.d.ts.map +1 -1
- package/dist/components/Utils/Postgraphile/FilterTransformer.d.ts.map +1 -1
- package/dist/components/Utils/Postgraphile/SortTransformer.d.ts.map +1 -1
- package/dist/components/Utils/State/GlobalState.d.ts.map +1 -1
- package/dist/helpers/idleCallbackHelpers.d.ts +0 -1
- package/dist/helpers/idleCallbackHelpers.d.ts.map +1 -1
- package/dist/helpers/storybook.d.ts.map +1 -1
- package/dist/helpers/testing.d.ts +6 -21
- package/dist/helpers/testing.d.ts.map +1 -1
- package/dist/helpers/utils.d.ts +1 -2
- package/dist/helpers/utils.d.ts.map +1 -1
- package/dist/hooks/useDEBUGDetectChanges/useDEBUGDetectChanges.d.ts.map +1 -1
- package/dist/hooks/useDEBUGRenderCount/useDEBUGRenderCount.d.ts.map +1 -1
- package/dist/hooks/useDebounce/useDebounce.d.ts +1 -2
- package/dist/hooks/useDebounce/useDebounce.d.ts.map +1 -1
- package/dist/hooks/useExpand/useExpand.d.ts.map +1 -1
- package/dist/hooks/useReactRouterPause/utils.d.ts.map +1 -1
- package/dist/hooks/useResize/useResize.d.ts +0 -1
- package/dist/hooks/useResize/useResize.d.ts.map +1 -1
- package/dist/hooks/useTabTitle/useTabTitle.d.ts.map +1 -1
- package/dist/hooks/useValueOrOnDemand/useValueOrOnDemand.d.ts +1 -1
- package/dist/hooks/useValueOrOnDemand/useValueOrOnDemand.d.ts.map +1 -1
- package/dist/index.es.js +4 -4
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/utils/ErrorMapper/ErrorMapper.d.ts.map +1 -1
- package/dist/utils/ErrorTypeToStationError.d.ts.map +1 -1
- package/dist/utils/ToolTipHelpers.d.ts.map +1 -1
- package/dist/validators/timestamp/timestamp.d.ts.map +1 -1
- package/package.json +11 -10
- package/src/components/Accordion/Accordion.spec.tsx +1 -1
- package/src/components/Accordion/AccordionItem/AccordionItem.spec.tsx +2 -2
- package/src/components/Actions/Action/Action.spec.tsx +189 -228
- package/src/components/Actions/Actions.spec.tsx +42 -32
- package/src/components/Buttons/Button/Button.spec.tsx +110 -115
- package/src/components/Buttons/Button/Button.tsx +4 -0
- package/src/components/Buttons/Button.model.ts +2 -0
- package/src/components/Buttons/CompositeButton/CompositeButton.spec.tsx +122 -121
- package/src/components/Buttons/TextButton/TextButton.spec.tsx +85 -90
- package/src/components/ConfirmDialog/ConfirmDialog.spec.tsx +75 -79
- package/src/components/DateTime/DatePicker/DatePicker.spec.tsx +8 -7
- package/src/components/DateTime/DateTimePicker.spec.tsx +43 -62
- package/src/components/DateTime/TimePicker/ScrollColumn/ScrollColumn.spec.tsx +19 -16
- package/src/components/DateTime/TimePicker/TimePicker.spec.tsx +44 -73
- package/src/components/DynamicDataList/DynamicDataList.spec.tsx +112 -107
- package/src/components/DynamicDataList/DynamicListDataEntry/DynamicListDataEntry.spec.tsx +91 -144
- package/src/components/DynamicDataList/DynamicListDataEntry/DynamicListDataEntry.tsx +38 -20
- package/src/components/DynamicDataList/DynamicListDataEntry/Renderers/createInputRenderer/createInputRenderer.spec.tsx +18 -15
- package/src/components/DynamicDataList/DynamicListDataEntry/Renderers/createInputRenderer/createInputRenderer.tsx +2 -0
- package/src/components/DynamicDataList/DynamicListDataEntry/Renderers/createSelectRenderer/createSelectRenderer.spec.tsx +53 -28
- package/src/components/DynamicDataList/DynamicListDataEntry/Renderers/createSelectRenderer/createSelectRenderer.tsx +2 -0
- package/src/components/DynamicDataList/DynamicListDataEntry/Renderers/renderers.model.ts +2 -0
- package/src/components/DynamicDataList/DynamicListHeader/DynamicListHeader.scss +19 -5
- package/src/components/DynamicDataList/DynamicListHeader/DynamicListHeader.spec.tsx +72 -76
- package/src/components/DynamicDataList/DynamicListRow/DynamicListRow.scss +9 -2
- package/src/components/DynamicDataList/DynamicListRow/DynamicListRow.spec.tsx +86 -113
- package/src/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.actions.spec.ts +1 -0
- package/src/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.init.spec.ts +1 -0
- package/src/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.spec.ts +6 -5
- package/src/components/EmptyStation/EmptyStation.spec.tsx +41 -37
- package/src/components/Explorer/BulkEdit/FormFieldsConfigConverter.spec.tsx +29 -28
- package/src/components/Explorer/BulkEdit/FormFieldsConfigConverter.tsx +1 -0
- package/src/components/Explorer/BulkEdit/GenerateMutation.spec.tsx +1 -0
- package/src/components/Explorer/BulkEdit/helpers/FieldWrapper.scss +1 -0
- package/src/components/Explorer/BulkEdit/helpers/FieldWrapper.tsx +1 -0
- package/src/components/Explorer/Explorer.spec.tsx +513 -825
- package/src/components/Explorer/NavigationExplorer/NavigationExplorer.spec.tsx +90 -131
- package/src/components/Explorer/QuickEdit/useQuickEdit.spec.tsx +36 -56
- package/src/components/Explorer/SelectionExplorer/SelectionExplorer.spec.tsx +59 -65
- package/src/components/Explorer/helpers/InMemoryDataProvider.spec.ts +1 -0
- package/src/components/Explorer/helpers/useFilters.spec.tsx +13 -11
- package/src/components/Explorer/helpers/useStationMessage.spec.tsx +4 -3
- package/src/components/Explorer/helpers/useSubtitle.spec.tsx +1 -0
- package/src/components/FieldSelection/FieldSelection.scss +1 -1
- package/src/components/FieldSelection/FieldSelection.spec.tsx +1 -1
- package/src/components/FieldSelection/FieldSelection.tsx +6 -2
- package/src/components/Filters/Filter/Filter.spec.tsx +78 -47
- package/src/components/Filters/Filters.spec.tsx +56 -58
- package/src/components/Filters/SelectionTypes/DateTimeFilter/DateTimeFilter.spec.tsx +45 -46
- package/src/components/Filters/SelectionTypes/FreeTextFilter/FreeTextFilter.spec.tsx +23 -23
- package/src/components/Filters/SelectionTypes/NumericTextFilter/NumericTextFilter.spec.tsx +37 -28
- package/src/components/Filters/SelectionTypes/OptionsFilter/OptionsFilter.spec.tsx +14 -12
- package/src/components/Filters/Validators/DateRangeFilterValidator.spec.ts +1 -0
- package/src/components/Filters/Validators/NumberRangeFilterValidator.spec.ts +1 -0
- package/src/components/FormElements/BooleanView/BooleanViewField.spec.tsx +34 -31
- package/src/components/FormElements/Checkbox/Checkbox.spec.tsx +129 -128
- package/src/components/FormElements/CustomTags/CustomTags.spec.tsx +312 -446
- package/src/components/FormElements/DateTimeField/DateTimeText.spec.tsx +61 -52
- package/src/components/FormElements/DynamicDataListControl/DynamicDataListControl.spec.tsx +19 -24
- package/src/components/FormElements/FileUploadControl/FileUploadControl.spec.tsx +67 -60
- package/src/components/FormElements/FormElementContainer/FormElementContainer.spec.tsx +13 -12
- package/src/components/FormElements/FormGroup/FormGroup.scss +62 -0
- package/src/components/FormElements/FormGroup/FormGroup.stories.tsx +25 -0
- package/src/components/FormElements/FormGroup/FormGroup.tsx +60 -0
- package/src/components/FormElements/FormGroupTitle/FormGroupTitle.tsx +5 -0
- package/src/components/FormElements/Link/LinkField.spec.tsx +24 -23
- package/src/components/FormElements/MaskedSingleLineText/MaskedSingleLineText.spec.tsx +4 -3
- package/src/components/FormElements/Radio/Radio.spec.tsx +170 -172
- package/src/components/FormElements/ReadOnly/ReadOnlyField.spec.tsx +23 -22
- package/src/components/FormElements/ReadOnlyText/ReadOnlyTextField.spec.tsx +23 -22
- package/src/components/FormElements/Select/Select.spec.tsx +30 -29
- package/src/components/FormElements/SingleLineText/SingleLineText.spec.tsx +46 -42
- package/src/components/FormElements/Tags/Tags.spec.tsx +59 -53
- package/src/components/FormElements/TextArea/TextArea.spec.tsx +44 -29
- package/src/components/FormElements/ToggleButton/ToggleButton.spec.tsx +188 -165
- package/src/components/FormElements/index.ts +1 -0
- package/src/components/FormStation/FormStation.spec.tsx +273 -198
- package/src/components/FormStation/FormStation.stories.tsx +15 -13
- package/src/components/FormStation/FormStationHeader/FormStationHeader.tsx +5 -3
- package/src/components/FormStation/SaveOnNavigate/SaveOnNavigate.spec.tsx +23 -20
- package/src/components/FormStation/SaveOnNavigate/handleNavigationAttempt.spec.ts +25 -24
- package/src/components/FormStation/helpers/useTitle.spec.ts +9 -7
- package/src/components/Hub/Hub.spec.tsx +13 -10
- package/src/components/Hub/Tile/Tile.spec.tsx +29 -25
- package/src/components/Icons/Icons.spec.tsx +25 -27
- package/src/components/Icons/Icons.tsx +1 -1
- package/src/components/InfoPanel/InfoImage/InfoImage.spec.tsx +4 -3
- package/src/components/InfoPanel/InfoPanel.scss +2 -0
- package/src/components/InfoPanel/InfoPanel.spec.tsx +4 -3
- package/src/components/InfoPanel/Paragraph/Paragraph.spec.tsx +4 -3
- package/src/components/InfoPanel/Section/Section.spec.tsx +39 -46
- package/src/components/InfoPanel/hooks/useCollapse.ts +9 -7
- package/src/components/InlineMenu/InlineMenu.spec.tsx +24 -23
- package/src/components/InlineMenu/InlineMenu.tsx +3 -0
- package/src/components/LandingPageHeader/LandingPageHeader.spec.tsx +9 -8
- package/src/components/LandingPageTiles/LandingPageTiles.spec.tsx +29 -28
- package/src/components/LandingPageTiles/TileLarge/TileLarge.spec.tsx +68 -61
- package/src/components/LandingPageTiles/TileSmall/TileSmall.spec.tsx +50 -32
- package/src/components/List/List.spec.tsx +337 -241
- package/src/components/List/ListCheckBox/ListCheckBox.spec.tsx +54 -48
- package/src/components/List/ListHeader/ColumnLabel/ColumnLabel.scss +4 -1
- package/src/components/List/ListHeader/ColumnLabel/ColumnLabel.spec.tsx +46 -43
- package/src/components/List/ListHeader/ListHeader.spec.tsx +82 -66
- package/src/components/List/ListRow/ListRow.spec.tsx +125 -130
- package/src/components/List/ListRow/ListRowCell/ListRowCell.spec.tsx +57 -100
- package/src/components/List/ListRow/ListRowLoader.spec.tsx +16 -12
- package/src/components/List/ListRow/Renderers/BooleanDotRenderer/BooleanDotRenderer.spec.tsx +12 -9
- package/src/components/List/ListRow/Renderers/ExternalLinkRenderer/ExternalLinkRenderer.spec.tsx +40 -35
- package/src/components/List/ListRow/Renderers/StateRenderer/StateRenderer.spec.tsx +14 -17
- package/src/components/List/ListRow/Renderers/TagsRenderer/TagsRenderer.spec.tsx +18 -17
- package/src/components/List/ListRow/Renderers/TagsRenderer/TagsRenderer.tsx +2 -2
- package/src/components/List/ListRowRenderer/ListRowRenderer.spec.tsx +82 -68
- package/src/components/Loaders/ImageLoader/ImageLoader.spec.tsx +88 -96
- package/src/components/Loaders/Loader/Loader.spec.tsx +51 -24
- package/src/components/Message/Message.spec.tsx +56 -44
- package/src/components/MessageBar/MessageBar.scss +3 -0
- package/src/components/MessageBar/MessageBar.spec.tsx +88 -85
- package/src/components/Modal/Modal.spec.tsx +92 -87
- package/src/components/NavigationAwareStation/NavigationAwareStation.spec.tsx +23 -22
- package/src/components/PageHeader/PageHeader.spec.tsx +22 -21
- package/src/components/PageHeader/PageHeaderAction/PageHeaderAction.spec.tsx +275 -193
- package/src/components/PageHeader/PageHeaderActionsGroup/PageHeaderActionsGroup.spec.tsx +39 -34
- package/src/components/ProgressBar/ProgressBar.spec.tsx +18 -15
- package/src/components/Utils/Postgraphile/CreateConnectionRenderer.spec.ts +1 -0
- package/src/components/Utils/Postgraphile/FilterTransformer.spec.ts +1 -0
- package/src/components/Utils/Postgraphile/RangeTransformer.spec.ts +1 -0
- package/src/components/Utils/Postgraphile/SortTransformer.spec.ts +1 -0
- package/src/components/Utils/Postgraphile/UpdateGQLFragmentGenerator.spec.ts +1 -0
- package/src/components/Utils/Postgraphile/generateArrayMutations.spec.ts +1 -0
- package/src/components/Utils/Postgraphile/getArrayDiff.spec.ts +1 -0
- package/src/components/Utils/Postgraphile/getFormDiff.spec.ts +1 -0
- package/src/components/Utils/State/GlobalState.spec.ts +4 -2
- package/src/components/Utils/Transformers/Boolean.spec.ts +1 -0
- package/src/components/Utils/Transformers/DateTime.spec.ts +2 -1
- package/src/components/Utils/Transformers/FileSize.spec.ts +1 -0
- package/src/components/Utils/Transformers/SortArray.spec.ts +1 -0
- package/src/components/Utils/Transformers/Timestamp.spec.ts +3 -2
- package/src/components/Utils/Transformers/TitleCase.spec.ts +1 -0
- package/src/components/VisualElements/ImgElement.spec.tsx +34 -35
- package/src/components/VisualElements/SvgElement.spec.tsx +72 -69
- package/src/helpers/testing.ts +9 -76
- package/src/hooks/useBusy/useBusy.spec.tsx +8 -9
- package/src/hooks/useClickOutside/useClickOutside.spec.tsx +19 -51
- package/src/hooks/useDebounce/useDebounce.spec.tsx +31 -26
- package/src/hooks/useExpand/useExpand.spec.tsx +30 -21
- package/src/hooks/useTabTitle/useTabTitle.spec.tsx +18 -18
- package/src/hooks/useValueOrOnDemand/useValueOrOnDemand.spec.tsx +31 -52
- package/src/styles/variables.scss +3 -1
- package/src/utils/ErrorMapper/ApolloClient/ApolloErrorMapper.spec.ts +1 -0
- package/src/utils/ErrorMapper/ErrorMapper.spec.ts +1 -0
- package/src/utils/ErrorTypeToStationError.spec.tsx +12 -11
- package/src/utils/ToolTipHelpers.spec.ts +1 -0
- package/src/validators/timestamp/timestamp.spec.ts +1 -0
- package/dist/helpers/hooksTestingHelpers.d.ts +0 -7
- package/dist/helpers/hooksTestingHelpers.d.ts.map +0 -1
- package/src/helpers/hooksTestingHelpers.tsx +0 -22
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fireEvent, render } from '@testing-library/react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
4
4
|
import { DynamicListColumn } from '../DynamicDataList.model';
|
|
5
5
|
import { DynamicListRow, DynamicListRowProps } from './DynamicListRow';
|
|
6
6
|
|
|
@@ -54,7 +54,7 @@ const defaultProps: DynamicListRowProps<DynamicListRowTestData> = {
|
|
|
54
54
|
|
|
55
55
|
describe('DynamicListRow', () => {
|
|
56
56
|
it('renders the component without crashing', () => {
|
|
57
|
-
const
|
|
57
|
+
const { container } = render(
|
|
58
58
|
<DynamicListRow
|
|
59
59
|
columns={defaultColumns}
|
|
60
60
|
columnSizes={defaultProps.columnSizes}
|
|
@@ -62,11 +62,11 @@ describe('DynamicListRow', () => {
|
|
|
62
62
|
/>,
|
|
63
63
|
);
|
|
64
64
|
|
|
65
|
-
expect(
|
|
65
|
+
expect(container).toBeTruthy();
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
it('most styling props, except gridTemplateColumns, should be undefined by default', () => {
|
|
69
|
-
const
|
|
69
|
+
const { container } = render(
|
|
70
70
|
<DynamicListRow
|
|
71
71
|
columns={defaultColumns}
|
|
72
72
|
columnSizes={defaultProps.columnSizes}
|
|
@@ -75,50 +75,33 @@ describe('DynamicListRow', () => {
|
|
|
75
75
|
/>,
|
|
76
76
|
);
|
|
77
77
|
|
|
78
|
-
const row =
|
|
78
|
+
const row = container.querySelector('.container') as HTMLElement;
|
|
79
79
|
|
|
80
|
-
expect(row.
|
|
81
|
-
expect(row.
|
|
82
|
-
expect(row.
|
|
83
|
-
'gridAutoRows',
|
|
80
|
+
expect(row.style.gridColumnGap).toBe('');
|
|
81
|
+
expect(row.style.alignItems).toBe('');
|
|
82
|
+
expect(row.style.gridAutoRows).toBe(
|
|
84
83
|
`minmax(50px, ${defaultProps.rowHeight})`,
|
|
85
84
|
);
|
|
86
|
-
expect(row.
|
|
87
|
-
|
|
88
|
-
defaultProps.columnSizes,
|
|
89
|
-
);
|
|
90
|
-
expect(row.prop('style')).toHaveProperty('justifyItems', undefined);
|
|
85
|
+
expect(row.style.gridTemplateColumns).toBe(defaultProps.columnSizes);
|
|
86
|
+
expect(row.style.justifyItems).toBe('');
|
|
91
87
|
});
|
|
92
88
|
|
|
93
89
|
it('sets styling props when passed in', () => {
|
|
94
|
-
const
|
|
90
|
+
const { container } = render(<DynamicListRow {...defaultProps} />);
|
|
95
91
|
|
|
96
|
-
const row =
|
|
92
|
+
const row = container.querySelector('.container') as HTMLElement;
|
|
97
93
|
|
|
98
|
-
expect(row.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
);
|
|
102
|
-
expect(row.prop('style')).toHaveProperty(
|
|
103
|
-
'alignItems',
|
|
104
|
-
defaultProps.verticalTextAlign,
|
|
105
|
-
);
|
|
106
|
-
expect(row.prop('style')).toHaveProperty(
|
|
107
|
-
'gridAutoRows',
|
|
94
|
+
expect(row.style.gridColumnGap).toBe(defaultProps.columnGap);
|
|
95
|
+
expect(row.style.alignItems).toBe(defaultProps.verticalTextAlign);
|
|
96
|
+
expect(row.style.gridAutoRows).toBe(
|
|
108
97
|
`minmax(50px, ${defaultProps.rowHeight})`,
|
|
109
98
|
);
|
|
110
|
-
expect(row.
|
|
111
|
-
|
|
112
|
-
defaultProps.columnSizes,
|
|
113
|
-
);
|
|
114
|
-
expect(row.prop('style')).toHaveProperty(
|
|
115
|
-
'justifyItems',
|
|
116
|
-
defaultProps.horizontalTextAlign,
|
|
117
|
-
);
|
|
99
|
+
expect(row.style.gridTemplateColumns).toBe(defaultProps.columnSizes);
|
|
100
|
+
expect(row.style.justifyItems).toBe(defaultProps.horizontalTextAlign);
|
|
118
101
|
});
|
|
119
102
|
|
|
120
103
|
it(`Button component should have type of 'button'`, () => {
|
|
121
|
-
const
|
|
104
|
+
const { container } = render(
|
|
122
105
|
<DynamicListRow
|
|
123
106
|
{...defaultProps}
|
|
124
107
|
allowRemove={true}
|
|
@@ -126,18 +109,18 @@ describe('DynamicListRow', () => {
|
|
|
126
109
|
/>,
|
|
127
110
|
);
|
|
128
111
|
|
|
129
|
-
const button =
|
|
112
|
+
const button = container.querySelector('button');
|
|
130
113
|
|
|
131
|
-
expect(button
|
|
114
|
+
expect(button?.type).toBe('button');
|
|
132
115
|
});
|
|
133
116
|
|
|
134
117
|
it('renders the value for every column if set', () => {
|
|
135
|
-
const
|
|
118
|
+
const { container } = render(<DynamicListRow {...defaultProps} />);
|
|
136
119
|
|
|
137
|
-
const columns =
|
|
120
|
+
const columns = container.querySelectorAll('.column');
|
|
138
121
|
|
|
139
122
|
columns.forEach((column, idx) => {
|
|
140
|
-
expect(column.
|
|
123
|
+
expect(column.textContent).toBe(
|
|
141
124
|
String(defaultData[defaultColumns[idx].propertyName!]),
|
|
142
125
|
);
|
|
143
126
|
});
|
|
@@ -151,7 +134,7 @@ describe('DynamicListRow', () => {
|
|
|
151
134
|
position: 3,
|
|
152
135
|
};
|
|
153
136
|
|
|
154
|
-
const
|
|
137
|
+
const { container } = render(
|
|
155
138
|
<DynamicListRow
|
|
156
139
|
columnSizes={''}
|
|
157
140
|
columns={defaultColumns}
|
|
@@ -161,9 +144,9 @@ describe('DynamicListRow', () => {
|
|
|
161
144
|
/>,
|
|
162
145
|
);
|
|
163
146
|
|
|
164
|
-
const position =
|
|
147
|
+
const position = container.querySelector('.position');
|
|
165
148
|
|
|
166
|
-
expect(position
|
|
149
|
+
expect(position).toBeInTheDocument();
|
|
167
150
|
});
|
|
168
151
|
|
|
169
152
|
it(`doesn't render the position column if 'showPositionColumn' is false`, () => {
|
|
@@ -174,7 +157,7 @@ describe('DynamicListRow', () => {
|
|
|
174
157
|
position: 3,
|
|
175
158
|
};
|
|
176
159
|
|
|
177
|
-
const
|
|
160
|
+
const { container } = render(
|
|
178
161
|
<DynamicListRow
|
|
179
162
|
columnSizes={''}
|
|
180
163
|
columns={defaultColumns}
|
|
@@ -184,9 +167,9 @@ describe('DynamicListRow', () => {
|
|
|
184
167
|
/>,
|
|
185
168
|
);
|
|
186
169
|
|
|
187
|
-
const position =
|
|
170
|
+
const position = container.querySelector('.position');
|
|
188
171
|
|
|
189
|
-
expect(position
|
|
172
|
+
expect(position).not.toBeInTheDocument();
|
|
190
173
|
});
|
|
191
174
|
|
|
192
175
|
it('uses custom renderer', () => {
|
|
@@ -198,20 +181,20 @@ describe('DynamicListRow', () => {
|
|
|
198
181
|
},
|
|
199
182
|
];
|
|
200
183
|
|
|
201
|
-
const
|
|
184
|
+
const { container } = render(
|
|
202
185
|
<DynamicListRow
|
|
203
186
|
columns={columnsWithRenderFunc}
|
|
204
187
|
columnSizes={defaultProps.columnSizes}
|
|
205
188
|
data={defaultProps.data}
|
|
206
189
|
/>,
|
|
207
190
|
);
|
|
208
|
-
const actualColumns =
|
|
191
|
+
const actualColumns = container.querySelectorAll('.column');
|
|
209
192
|
|
|
210
|
-
expect(actualColumns
|
|
193
|
+
expect(actualColumns[0].textContent).toBe('Changed: title');
|
|
211
194
|
});
|
|
212
195
|
|
|
213
196
|
it(`doesn't allow dragging if showPositionColumn is 'false'`, () => {
|
|
214
|
-
const
|
|
197
|
+
const { container } = render(
|
|
215
198
|
<DynamicListRow
|
|
216
199
|
columns={defaultColumns}
|
|
217
200
|
columnSizes={defaultProps.columnSizes}
|
|
@@ -222,12 +205,12 @@ describe('DynamicListRow', () => {
|
|
|
222
205
|
/>,
|
|
223
206
|
);
|
|
224
207
|
|
|
225
|
-
const dragIcon =
|
|
226
|
-
expect(dragIcon
|
|
208
|
+
const dragIcon = container.querySelector('.draggable');
|
|
209
|
+
expect(dragIcon).not.toBeInTheDocument();
|
|
227
210
|
});
|
|
228
211
|
|
|
229
212
|
it(`only allows dragging if both showPositionColumn and allowDragging are 'true'`, () => {
|
|
230
|
-
const
|
|
213
|
+
const { container } = render(
|
|
231
214
|
<DynamicListRow
|
|
232
215
|
columns={defaultColumns}
|
|
233
216
|
columnSizes={defaultProps.columnSizes}
|
|
@@ -238,13 +221,13 @@ describe('DynamicListRow', () => {
|
|
|
238
221
|
/>,
|
|
239
222
|
);
|
|
240
223
|
|
|
241
|
-
const dragIcon =
|
|
224
|
+
const dragIcon = container.querySelector('.draggable');
|
|
242
225
|
|
|
243
|
-
expect(dragIcon
|
|
226
|
+
expect(dragIcon).toBeInTheDocument();
|
|
244
227
|
});
|
|
245
228
|
|
|
246
229
|
it(`doesn't display an action button by default`, () => {
|
|
247
|
-
const
|
|
230
|
+
const { container } = render(
|
|
248
231
|
<DynamicListRow
|
|
249
232
|
columns={defaultColumns}
|
|
250
233
|
columnSizes={defaultProps.columnSizes}
|
|
@@ -252,13 +235,13 @@ describe('DynamicListRow', () => {
|
|
|
252
235
|
/>,
|
|
253
236
|
);
|
|
254
237
|
|
|
255
|
-
const button =
|
|
238
|
+
const button = container.querySelector('button');
|
|
256
239
|
|
|
257
|
-
expect(button
|
|
240
|
+
expect(button).not.toBeInTheDocument();
|
|
258
241
|
});
|
|
259
242
|
|
|
260
243
|
it(`displays an action button if 'showActionColumn' is set to true`, () => {
|
|
261
|
-
const
|
|
244
|
+
const { container } = render(
|
|
262
245
|
<DynamicListRow
|
|
263
246
|
columns={defaultColumns}
|
|
264
247
|
columnSizes={defaultProps.columnSizes}
|
|
@@ -268,14 +251,14 @@ describe('DynamicListRow', () => {
|
|
|
268
251
|
/>,
|
|
269
252
|
);
|
|
270
253
|
|
|
271
|
-
const button =
|
|
254
|
+
const button = container.querySelector('button');
|
|
272
255
|
|
|
273
|
-
expect(button
|
|
256
|
+
expect(button).toBeInTheDocument();
|
|
274
257
|
});
|
|
275
258
|
|
|
276
259
|
it(`emits onActionClicked with row data when the action button is clicked`, () => {
|
|
277
|
-
const spy =
|
|
278
|
-
const
|
|
260
|
+
const spy = vi.fn();
|
|
261
|
+
const { container } = render(
|
|
279
262
|
<DynamicListRow
|
|
280
263
|
columns={defaultColumns}
|
|
281
264
|
columnSizes={defaultProps.columnSizes}
|
|
@@ -286,18 +269,18 @@ describe('DynamicListRow', () => {
|
|
|
286
269
|
/>,
|
|
287
270
|
);
|
|
288
271
|
|
|
289
|
-
const button =
|
|
272
|
+
const button = container.querySelector('button') as HTMLButtonElement;
|
|
290
273
|
|
|
291
|
-
|
|
274
|
+
fireEvent.click(button);
|
|
292
275
|
|
|
293
276
|
expect(spy).toHaveBeenCalledTimes(1);
|
|
294
277
|
expect(spy).toHaveBeenCalledWith(defaultData);
|
|
295
278
|
});
|
|
296
279
|
|
|
297
280
|
it('emits onPositionInputChanged with the current position and the new target position', () => {
|
|
298
|
-
const inputSpy =
|
|
281
|
+
const inputSpy = vi.fn();
|
|
299
282
|
const mockNewPosition = '9';
|
|
300
|
-
const
|
|
283
|
+
const { container } = render(
|
|
301
284
|
<DynamicListRow
|
|
302
285
|
columns={defaultColumns}
|
|
303
286
|
columnSizes={defaultProps.columnSizes}
|
|
@@ -308,12 +291,10 @@ describe('DynamicListRow', () => {
|
|
|
308
291
|
/>,
|
|
309
292
|
);
|
|
310
293
|
|
|
311
|
-
const input =
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
currentTarget: { value: mockNewPosition },
|
|
316
|
-
});
|
|
294
|
+
const input = container.querySelector('input') as HTMLInputElement;
|
|
295
|
+
|
|
296
|
+
fireEvent.change(input, { target: { value: mockNewPosition } });
|
|
297
|
+
fireEvent.keyDown(input, { key: 'Enter' });
|
|
317
298
|
|
|
318
299
|
expect(inputSpy).toHaveBeenCalledTimes(1);
|
|
319
300
|
expect(inputSpy).toHaveBeenCalledWith(
|
|
@@ -321,10 +302,8 @@ describe('DynamicListRow', () => {
|
|
|
321
302
|
Number(mockNewPosition),
|
|
322
303
|
);
|
|
323
304
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
currentTarget: { value: mockNewPosition },
|
|
327
|
-
});
|
|
305
|
+
fireEvent.change(input, { target: { value: mockNewPosition } });
|
|
306
|
+
fireEvent.blur(input);
|
|
328
307
|
|
|
329
308
|
expect(inputSpy).toHaveBeenCalledTimes(2);
|
|
330
309
|
expect(inputSpy).toHaveBeenCalledWith(
|
|
@@ -334,9 +313,9 @@ describe('DynamicListRow', () => {
|
|
|
334
313
|
});
|
|
335
314
|
|
|
336
315
|
it('onPositionInputChanged is not emitted if current position and new position are the same', () => {
|
|
337
|
-
const inputSpy =
|
|
316
|
+
const inputSpy = vi.fn();
|
|
338
317
|
const mockNewPosition = dataWithPosition.position;
|
|
339
|
-
const
|
|
318
|
+
const { container } = render(
|
|
340
319
|
<DynamicListRow
|
|
341
320
|
columns={defaultColumns}
|
|
342
321
|
columnSizes={defaultProps.columnSizes}
|
|
@@ -347,19 +326,17 @@ describe('DynamicListRow', () => {
|
|
|
347
326
|
/>,
|
|
348
327
|
);
|
|
349
328
|
|
|
350
|
-
const input =
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
currentTarget: { value: mockNewPosition },
|
|
355
|
-
});
|
|
329
|
+
const input = container.querySelector('input') as HTMLInputElement;
|
|
330
|
+
|
|
331
|
+
fireEvent.change(input, { target: { value: String(mockNewPosition) } });
|
|
332
|
+
fireEvent.keyDown(input, { key: 'Enter' });
|
|
356
333
|
|
|
357
334
|
expect(inputSpy).not.toHaveBeenCalled();
|
|
358
335
|
});
|
|
359
336
|
|
|
360
337
|
it('input will update if value is a valid number', () => {
|
|
361
338
|
const mockNewPosition = 5;
|
|
362
|
-
const
|
|
339
|
+
const { container } = render(
|
|
363
340
|
<DynamicListRow
|
|
364
341
|
columns={defaultColumns}
|
|
365
342
|
columnSizes={defaultProps.columnSizes}
|
|
@@ -369,22 +346,20 @@ describe('DynamicListRow', () => {
|
|
|
369
346
|
/>,
|
|
370
347
|
);
|
|
371
348
|
|
|
372
|
-
let input =
|
|
373
|
-
|
|
374
|
-
expect(input.prop('value')).toBe(dataWithPosition.position);
|
|
349
|
+
let input = container.querySelector('input') as HTMLInputElement;
|
|
375
350
|
|
|
376
|
-
input.
|
|
351
|
+
expect(input.value).toBe(String(dataWithPosition.position));
|
|
377
352
|
|
|
378
|
-
|
|
353
|
+
fireEvent.change(input, { target: { value: String(mockNewPosition) } });
|
|
379
354
|
|
|
380
|
-
input =
|
|
355
|
+
input = container.querySelector('input') as HTMLInputElement;
|
|
381
356
|
|
|
382
|
-
expect(input.
|
|
357
|
+
expect(input.value).toBe(String(mockNewPosition));
|
|
383
358
|
});
|
|
384
359
|
|
|
385
360
|
it('input will not update if value is not a valid number', () => {
|
|
386
361
|
const mockNewPosition = 'NaN';
|
|
387
|
-
const
|
|
362
|
+
const { container } = render(
|
|
388
363
|
<DynamicListRow
|
|
389
364
|
columns={defaultColumns}
|
|
390
365
|
columnSizes={defaultProps.columnSizes}
|
|
@@ -394,17 +369,15 @@ describe('DynamicListRow', () => {
|
|
|
394
369
|
/>,
|
|
395
370
|
);
|
|
396
371
|
|
|
397
|
-
let input =
|
|
398
|
-
|
|
399
|
-
expect(input.prop('value')).toBe(dataWithPosition.position);
|
|
372
|
+
let input = container.querySelector('input') as HTMLInputElement;
|
|
400
373
|
|
|
401
|
-
input.
|
|
374
|
+
expect(input.value).toBe(String(dataWithPosition.position));
|
|
402
375
|
|
|
403
|
-
|
|
376
|
+
fireEvent.change(input, { target: { value: mockNewPosition } });
|
|
404
377
|
|
|
405
|
-
input =
|
|
378
|
+
input = container.querySelector('input') as HTMLInputElement;
|
|
406
379
|
|
|
407
|
-
expect(input.
|
|
380
|
+
expect(input.value).toBe(String(dataWithPosition.position));
|
|
408
381
|
});
|
|
409
382
|
|
|
410
383
|
describe('DynamicListRow column text alignments', () => {
|
|
@@ -420,7 +393,7 @@ describe('DynamicListRow', () => {
|
|
|
420
393
|
|
|
421
394
|
alignments.forEach(({ horizontal, vertical }) => {
|
|
422
395
|
it(`should apply the correct styles for justify-content: ${horizontal}, align-items: ${vertical}`, () => {
|
|
423
|
-
const
|
|
396
|
+
const { container } = render(
|
|
424
397
|
<DynamicListRow
|
|
425
398
|
columns={defaultColumns}
|
|
426
399
|
columnSizes={defaultProps.columnSizes}
|
|
@@ -432,13 +405,13 @@ describe('DynamicListRow', () => {
|
|
|
432
405
|
/>,
|
|
433
406
|
);
|
|
434
407
|
|
|
435
|
-
const wrapperDivs =
|
|
408
|
+
const wrapperDivs = container.querySelectorAll('.wrapper');
|
|
436
409
|
|
|
437
410
|
wrapperDivs.forEach((node) => {
|
|
438
|
-
const
|
|
411
|
+
const element = node as HTMLElement;
|
|
439
412
|
|
|
440
|
-
expect(style).
|
|
441
|
-
expect(style).
|
|
413
|
+
expect(element.style.justifyContent).toBe(horizontal || '');
|
|
414
|
+
expect(element.style.alignItems).toBe(vertical || '');
|
|
442
415
|
});
|
|
443
416
|
});
|
|
444
417
|
});
|
|
@@ -446,7 +419,7 @@ describe('DynamicListRow', () => {
|
|
|
446
419
|
|
|
447
420
|
describe('tooltip', () => {
|
|
448
421
|
it(`renders a tooltip using the 'title' html attribute by default`, () => {
|
|
449
|
-
const
|
|
422
|
+
const { container } = render(
|
|
450
423
|
<DynamicListRow
|
|
451
424
|
columns={defaultColumns}
|
|
452
425
|
columnSizes={defaultProps.columnSizes}
|
|
@@ -454,10 +427,10 @@ describe('DynamicListRow', () => {
|
|
|
454
427
|
/>,
|
|
455
428
|
);
|
|
456
429
|
|
|
457
|
-
const columns =
|
|
430
|
+
const columns = container.querySelectorAll('.column');
|
|
458
431
|
|
|
459
432
|
columns.forEach((column) => {
|
|
460
|
-
expect(column.
|
|
433
|
+
expect(column.getAttribute('title')).toBe(column.textContent);
|
|
461
434
|
});
|
|
462
435
|
});
|
|
463
436
|
|
|
@@ -467,7 +440,7 @@ describe('DynamicListRow', () => {
|
|
|
467
440
|
tooltip: false,
|
|
468
441
|
}));
|
|
469
442
|
|
|
470
|
-
const
|
|
443
|
+
const { container } = render(
|
|
471
444
|
<DynamicListRow
|
|
472
445
|
columns={mockColumns}
|
|
473
446
|
columnSizes={defaultProps.columnSizes}
|
|
@@ -475,10 +448,10 @@ describe('DynamicListRow', () => {
|
|
|
475
448
|
/>,
|
|
476
449
|
);
|
|
477
450
|
|
|
478
|
-
const columns =
|
|
451
|
+
const columns = container.querySelectorAll('.column');
|
|
479
452
|
|
|
480
453
|
columns.forEach((column) => {
|
|
481
|
-
expect(column.
|
|
454
|
+
expect(column.getAttribute('title')).toBeNull();
|
|
482
455
|
});
|
|
483
456
|
});
|
|
484
457
|
});
|
package/src/components/DynamicDataList/helpers/DynamicListReducer/DynamicListReducer.spec.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
1
2
|
import { DynamicListReducer } from './DynamicListReducer';
|
|
2
3
|
import { addItem, removeItem } from './DynamicListReducer.actions';
|
|
3
4
|
import { DynamicListReducerInit } from './DynamicListReducer.init';
|
|
@@ -6,10 +7,10 @@ import {
|
|
|
6
7
|
DynamicListReducerState,
|
|
7
8
|
} from './DynamicListReducer.types';
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
addItem:
|
|
12
|
-
removeItem:
|
|
10
|
+
vi.mock('./DynamicListReducer.init');
|
|
11
|
+
vi.mock('./DynamicListReducer.actions', () => ({
|
|
12
|
+
addItem: vi.fn(),
|
|
13
|
+
removeItem: vi.fn().mockReturnValue([]),
|
|
13
14
|
}));
|
|
14
15
|
|
|
15
16
|
interface Data {
|
|
@@ -39,7 +40,7 @@ const initialState: DynamicListReducerState<Data> = {
|
|
|
39
40
|
|
|
40
41
|
describe('Dynamic List Reducer', () => {
|
|
41
42
|
beforeEach(() => {
|
|
42
|
-
|
|
43
|
+
vi.clearAllMocks();
|
|
43
44
|
});
|
|
44
45
|
|
|
45
46
|
it('calls addItem and DynamicListReducerInit when action is add', () => {
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
3
4
|
import { noop } from '../../helpers/utils';
|
|
4
5
|
import { initializeUi } from '../../initialize';
|
|
5
|
-
import { MessageBar } from '../MessageBar';
|
|
6
|
-
import { PageHeader } from '../PageHeader';
|
|
7
6
|
import { StationError } from '../models';
|
|
8
7
|
import { EmptyStation, EmptyStationProps } from './EmptyStation';
|
|
9
8
|
|
|
10
9
|
describe('EmptyStation', () => {
|
|
11
|
-
global.ResizeObserver =
|
|
12
|
-
observe:
|
|
13
|
-
|
|
14
|
-
disconnect: jest.fn(),
|
|
15
|
-
}));
|
|
10
|
+
global.ResizeObserver = vi.fn().mockImplementation(function () {
|
|
11
|
+
return { observe: vi.fn(), unobserve: vi.fn(), disconnect: vi.fn() };
|
|
12
|
+
}) as unknown as typeof ResizeObserver;
|
|
16
13
|
|
|
17
14
|
beforeEach(() => {
|
|
18
15
|
initializeUi({
|
|
@@ -35,64 +32,71 @@ describe('EmptyStation', () => {
|
|
|
35
32
|
subtitle: 'test-subtitle',
|
|
36
33
|
};
|
|
37
34
|
it('renders the component without crashing', () => {
|
|
38
|
-
const
|
|
35
|
+
const { container } = render(<EmptyStation {...defaultProps} />);
|
|
39
36
|
|
|
40
|
-
expect(
|
|
37
|
+
expect(container).toBeTruthy();
|
|
41
38
|
});
|
|
42
39
|
|
|
43
40
|
it('renders a PageHeader', () => {
|
|
44
|
-
const
|
|
41
|
+
const { container } = render(<EmptyStation {...defaultProps} />);
|
|
45
42
|
|
|
46
|
-
const pageHeader =
|
|
43
|
+
const pageHeader = container.querySelector('[data-test-id="page-header"]');
|
|
47
44
|
|
|
48
|
-
expect(pageHeader
|
|
45
|
+
expect(pageHeader).toBeInTheDocument();
|
|
49
46
|
});
|
|
50
47
|
|
|
51
48
|
describe('station error', () => {
|
|
52
49
|
it('renders a station error, if set', () => {
|
|
53
50
|
const err: StationError = { title: 'test-title' };
|
|
54
|
-
const
|
|
51
|
+
const { container, rerender } = render(
|
|
52
|
+
<EmptyStation {...defaultProps} />,
|
|
53
|
+
);
|
|
55
54
|
|
|
56
|
-
let messageBar =
|
|
57
|
-
let
|
|
55
|
+
let messageBar = screen.queryByTestId('message-title');
|
|
56
|
+
let stationContainer = container.querySelector('.container');
|
|
58
57
|
|
|
59
|
-
expect(messageBar
|
|
60
|
-
expect(
|
|
58
|
+
expect(messageBar).not.toBeInTheDocument();
|
|
59
|
+
expect(stationContainer?.classList.contains('hasStationError')).toBe(
|
|
60
|
+
false,
|
|
61
|
+
);
|
|
61
62
|
|
|
62
|
-
|
|
63
|
-
wrapper.update();
|
|
63
|
+
rerender(<EmptyStation {...defaultProps} stationError={err} />);
|
|
64
64
|
|
|
65
|
-
messageBar =
|
|
66
|
-
|
|
65
|
+
messageBar = screen.getByTestId('message-title');
|
|
66
|
+
stationContainer = container.querySelector('.container');
|
|
67
67
|
|
|
68
|
-
expect(messageBar
|
|
69
|
-
expect(messageBar.
|
|
70
|
-
expect(
|
|
71
|
-
|
|
68
|
+
expect(messageBar).toBeInTheDocument();
|
|
69
|
+
expect(messageBar.textContent).toBe(err.title);
|
|
70
|
+
expect(stationContainer?.classList.contains('hasStationError')).toBe(
|
|
71
|
+
true,
|
|
72
|
+
);
|
|
72
73
|
});
|
|
73
74
|
|
|
74
75
|
it('renders MessageBar body, if set', () => {
|
|
75
76
|
const err: StationError = { title: 'test-title' };
|
|
76
77
|
const mockBody = 'test-body';
|
|
77
|
-
const
|
|
78
|
+
const { container, rerender } = render(
|
|
78
79
|
<EmptyStation {...defaultProps} stationError={err} />,
|
|
79
80
|
);
|
|
80
81
|
|
|
81
|
-
let toggle =
|
|
82
|
+
let toggle = screen.queryByTestId('message-bar-details-button');
|
|
82
83
|
|
|
83
|
-
expect(toggle
|
|
84
|
+
expect(toggle).not.toBeInTheDocument();
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
rerender(
|
|
87
|
+
<EmptyStation
|
|
88
|
+
{...defaultProps}
|
|
89
|
+
stationError={{ ...err, body: mockBody }}
|
|
90
|
+
/>,
|
|
91
|
+
);
|
|
87
92
|
|
|
88
|
-
toggle =
|
|
89
|
-
expect(toggle
|
|
93
|
+
toggle = screen.getByTestId('message-bar-details-button');
|
|
94
|
+
expect(toggle).toBeInTheDocument();
|
|
90
95
|
|
|
91
|
-
|
|
92
|
-
wrapper.update();
|
|
96
|
+
fireEvent.click(toggle);
|
|
93
97
|
|
|
94
|
-
const body =
|
|
95
|
-
expect(body
|
|
98
|
+
const body = container.querySelector('.body');
|
|
99
|
+
expect(body?.textContent).toBe(mockBody);
|
|
96
100
|
});
|
|
97
101
|
});
|
|
98
102
|
});
|