@griddo/ax 12.3.0 → 12.4.0
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/config/{jest/componentsMock.js → tests/componentsMock.cjs} +4 -1
- package/config/tests/reactEasyCropMock.js +15 -0
- package/config/tests/reactTimezoneMock.js +14 -0
- package/config/tests/setup.ts +41 -0
- package/package.json +15 -29
- package/public/img/icons/markdown.svg +6 -0
- package/src/__tests__/components/ActionMenu/ActionMenu.test.tsx +12 -12
- package/src/__tests__/components/Breadcrumb/Breadcrumb.test.tsx +2 -2
- package/src/__tests__/components/Browser/Browser.test.tsx +17 -25
- package/src/__tests__/components/BulkSelectionOptions/BulkSelectionOptions.test.tsx +3 -3
- package/src/__tests__/components/CategoryCell/CategoryCell.test.tsx +3 -2
- package/src/__tests__/components/ConfigPanel/ConfigPanel.test.tsx +4 -4
- package/src/__tests__/components/ConfigPanel/Form/ConnectedField/ConnectedField.test.tsx +2 -2
- package/src/__tests__/components/ConfigPanel/Form/ConnectedField/NavConnectedField/NavConnectedField.test.tsx +2 -2
- package/src/__tests__/components/ConfigPanel/Form/ConnectedField/PageConnectedField/Field/Field.test.tsx +3 -3
- package/src/__tests__/components/ConfigPanel/Form/ConnectedField/PageConnectedField/PageConnectedField.test.tsx +17 -14
- package/src/__tests__/components/ConfigPanel/Form/ConnectedField/PageConnectedField/TemplateManager/TemplateManager.test.tsx +4 -4
- package/src/__tests__/components/ConfigPanel/Form/Form.test.tsx +7 -6
- package/src/__tests__/components/ConfigPanel/GlobalPageForm/GlobalPageForm.test.tsx +11 -11
- package/src/__tests__/components/ConfigPanel/Header/Header.test.tsx +11 -10
- package/src/__tests__/components/ConfigPanel/NavigationForm/Field/Field.test.tsx +2 -2
- package/src/__tests__/components/ConfigPanel/NavigationForm/NavigationForm.test.tsx +2 -2
- package/src/__tests__/components/ConfigPanel/PreviewForm/PreviewForm.test.tsx +4 -3
- package/src/__tests__/components/ContextMenu/ContextMenu.test.tsx +24 -24
- package/src/__tests__/components/DragAndDrop/DragAndDrop.test.tsx +6 -5
- package/src/__tests__/components/ElementsTooltip/ElementsTooltip.test.tsx +1 -1
- package/src/__tests__/components/EmptyState/EmptyState.test.tsx +2 -2
- package/src/__tests__/components/ErrorCenter/ErrorCenter.test.tsx +11 -11
- package/src/__tests__/components/FieldContainer/FieldContainer.test.tsx +4 -4
- package/src/__tests__/components/Fields/AnalyticsField/AnalyticsField.test.tsx +3 -3
- package/src/__tests__/components/Fields/AnalyticsField/PageAnalytics/PageAnalytics.test.tsx +4 -4
- package/src/__tests__/components/Fields/AnalyticsField/StructuredDataAnalytics/StructuredDataAnalytics.test.tsx +3 -3
- package/src/__tests__/components/Fields/ArrayFieldGroup/ArrayFieldGroup.test.tsx +6 -5
- package/src/__tests__/components/Fields/AsyncCheckGroup/AsyncCheckGroup.test.tsx +19 -18
- package/src/__tests__/components/Fields/AsyncSelect/AsyncSelect.test.tsx +4 -3
- package/src/__tests__/components/Fields/Button/Button.test.tsx +4 -3
- package/src/__tests__/components/Fields/CheckField/CheckField.test.tsx +5 -5
- package/src/__tests__/components/Fields/CheckGroup/CheckGroup.test.tsx +10 -10
- package/src/__tests__/components/Fields/ColorPicker/ColorPicker.test.tsx +7 -6
- package/src/__tests__/components/Fields/ComponentArray/ComponentArray.test.tsx +3 -3
- package/src/__tests__/components/Fields/ComponentArray/MixableComponentArray/MixableComponentArray.test.tsx +45 -45
- package/src/__tests__/components/Fields/ComponentArray/MixableComponentArray/PasteModuleButton/PasteModuleButton.test.tsx +7 -6
- package/src/__tests__/components/Fields/ComponentArray/SameComponentArray/SameComponentArray.test.tsx +7 -7
- package/src/__tests__/components/Fields/ComponentContainer/ComponentContainer.test.tsx +55 -55
- package/src/__tests__/components/Fields/ConditionalField/ConditionalField.test.tsx +1 -1
- package/src/__tests__/components/Fields/DateField/DateField.test.tsx +6 -5
- package/src/__tests__/components/Fields/FieldGroup/FieldGroup.test.tsx +2 -2
- package/src/__tests__/components/Fields/FileField/FileField.test.tsx +4 -4
- package/src/__tests__/components/Fields/HeadingField/HeadingField.test.tsx +2 -2
- package/src/__tests__/components/Fields/HiddenField/HiddenField.test.tsx +3 -3
- package/src/__tests__/components/Fields/ImageField/ImageField.test.tsx +8 -7
- package/src/__tests__/components/Fields/IntegrationsField/IntegrationsField.test.tsx +9 -8
- package/src/__tests__/components/Fields/MultiCheckSelect/MultiCheckSelect.test.tsx +1 -1
- package/src/__tests__/components/Fields/MultiCheckSelectGroup/MultiCheckSelectGroup.test.tsx +7 -6
- package/src/__tests__/components/Fields/NoteField/NoteField.test.tsx +1 -1
- package/src/__tests__/components/Fields/NumberField/NumberField.test.tsx +8 -8
- package/src/__tests__/components/Fields/RadioField/RadioField.test.tsx +2 -2
- package/src/__tests__/components/Fields/ReferenceField/ReferenceField.test.tsx +17 -16
- package/src/__tests__/components/Fields/RichText/RichText.test.tsx +1 -1
- package/src/__tests__/components/Fields/Select/Select.test.tsx +1 -1
- package/src/__tests__/components/Fields/SliderField/SliderField.test.tsx +5 -4
- package/src/__tests__/components/Fields/SummaryButton/SummaryButton.test.tsx +2 -2
- package/src/__tests__/components/Fields/TagField/TagField.test.tsx +9 -9
- package/src/__tests__/components/Fields/TextArea/TextArea.test.tsx +13 -9
- package/src/__tests__/components/Fields/TextField/TextField.test.tsx +8 -8
- package/src/__tests__/components/Fields/TimeField/HourInput/HourInput.test.tsx +7 -6
- package/src/__tests__/components/Fields/TimeField/TimeField.test.tsx +4 -3
- package/src/__tests__/components/Fields/ToggleField/ToggleField.test.tsx +2 -2
- package/src/__tests__/components/Fields/Tooltip/Tooltip.test.tsx +6 -6
- package/src/__tests__/components/Fields/TranslateButton/TranslateButton.test.tsx +13 -13
- package/src/__tests__/components/Fields/UniqueCheck/UniqueCheck.test.tsx +1 -1
- package/src/__tests__/components/Fields/UrlField/UrlField.test.tsx +20 -19
- package/src/__tests__/components/Fields/VisualUniqueSelection/ImageSelection/ImageSelection.test.tsx +3 -2
- package/src/__tests__/components/Fields/VisualUniqueSelection/ScrollableSelection/ScrollableSelection.test.tsx +4 -3
- package/src/__tests__/components/Fields/VisualUniqueSelection/VisualUniqueSelection.test.tsx +1 -1
- package/src/__tests__/components/Fields/Wysiwyg/Wysiwyg.atoms.test.tsx +11 -11
- package/src/__tests__/components/Fields/Wysiwyg/Wysiwyg.helpers.test.tsx +13 -14
- package/src/__tests__/components/Fields/Wysiwyg/Wysiwyg.test.tsx +28 -28
- package/src/__tests__/components/FieldsBehavior/FieldsBehavior.test.tsx +15 -14
- package/src/__tests__/components/FloatingMenu/FloatingMenu.test.tsx +36 -35
- package/src/__tests__/components/FloatingPanel/FloatingPanel.test.tsx +10 -10
- package/src/__tests__/components/GuardModal/GuardModal.test.tsx +1 -1
- package/src/__tests__/components/HeadingsPreviewModal/ErrorsBanner/ErrorItem/ErrorItem.test.tsx +11 -11
- package/src/__tests__/components/HeadingsPreviewModal/ErrorsBanner/ErrorsBanner.test.tsx +4 -4
- package/src/__tests__/components/HeadingsPreviewModal/HeadingsPreviewModal.test.tsx +15 -14
- package/src/__tests__/components/IconAction/IconAction.test.tsx +2 -2
- package/src/__tests__/components/ImageDragAndDrop/CropStep/CropStep.test.tsx +3 -3
- package/src/__tests__/components/ImageDragAndDrop/ImageDragAndDrop.test.tsx +7 -7
- package/src/__tests__/components/KeywordsPreviewModal/KeywordItem/KeywordItem.test.tsx +5 -5
- package/src/__tests__/components/KeywordsPreviewModal/KeywordsPreviewModal.test.tsx +14 -13
- package/src/__tests__/components/KeywordsPreviewModal/atoms.test.tsx +13 -13
- package/src/__tests__/components/LanguageMenu/LanguageMenu.test.tsx +6 -6
- package/src/__tests__/components/Lists/Lists.test.tsx +1 -1
- package/src/__tests__/components/Loader/Loader.test.tsx +1 -1
- package/src/__tests__/components/Login/Login.test.tsx +32 -32
- package/src/__tests__/components/Login/RecoveryModal/RecoveryModal.test.tsx +10 -9
- package/src/__tests__/components/MainWrapper/AppBar/AppBar.test.tsx +21 -21
- package/src/__tests__/components/MenuItem/MenuItem.test.tsx +5 -5
- package/src/__tests__/components/Modal/Modal.test.tsx +20 -20
- package/src/__tests__/components/Nav/Nav.test.tsx +2 -2
- package/src/__tests__/components/Notification/Notification.test.tsx +2 -2
- package/src/__tests__/components/Pagination/Pagination.test.tsx +13 -14
- package/src/__tests__/components/ProfileImage/ProfileImage.test.tsx +6 -7
- package/src/__tests__/components/ReorderArrows/ReorderArrows.test.tsx +4 -3
- package/src/__tests__/components/ResizePanel/ResizePanel.test.tsx +10 -11
- package/src/__tests__/components/RestrictionsModal/CurrentAccessList/CurrentAccessList.test.tsx +7 -6
- package/src/__tests__/components/RestrictionsModal/OptionsStep/OptionsStep.test.tsx +12 -11
- package/src/__tests__/components/RestrictionsModal/RestrictionsModal.test.tsx +11 -10
- package/src/__tests__/components/RestrictionsModal/RolesList/RolesList.test.tsx +8 -8
- package/src/__tests__/components/RestrictionsModal/UsersList/UsersList.test.tsx +16 -15
- package/src/__tests__/components/SearchField/SearchField.test.tsx +13 -13
- package/src/__tests__/components/SideModal/SideModal.test.tsx +25 -23
- package/src/__tests__/components/SubNav/SubNav.test.tsx +1 -1
- package/src/__tests__/components/TableFilters/CategoryFilter/CategoryFilter.test.tsx +9 -8
- package/src/__tests__/components/TableFilters/CustomizeFilters/CustomizeFilters.test.tsx +5 -5
- package/src/__tests__/components/TableFilters/DateFilter/DateFilter.test.tsx +8 -8
- package/src/__tests__/components/TableFilters/LiveFilter/LiveFilter.test.tsx +11 -10
- package/src/__tests__/components/TableFilters/NameFilter/NameFilter.test.tsx +10 -10
- package/src/__tests__/components/TableFilters/RoleFilter/RoleFilter.test.tsx +5 -5
- package/src/__tests__/components/TableFilters/SiteFilter/SiteFilter.test.tsx +10 -9
- package/src/__tests__/components/TableFilters/StatusFilter/StatusFilter.test.tsx +9 -9
- package/src/__tests__/components/TableFilters/TranslationsFilter/TranslationsFilter.test.tsx +8 -8
- package/src/__tests__/components/TableFilters/TypeFilter/TypeFilter.test.tsx +5 -5
- package/src/__tests__/components/TableFilters/UsersFilter/UsersFilter.test.tsx +8 -8
- package/src/__tests__/components/TableList/TableList.test.tsx +4 -4
- package/src/__tests__/components/Tabs/Tabs.test.tsx +8 -9
- package/src/__tests__/components/Tag/Tag.test.tsx +3 -3
- package/src/__tests__/components/Toast/Toast.test.tsx +6 -6
- package/src/__tests__/hooks/modals.test.tsx +4 -4
- package/src/__tests__/hooks/users.test.tsx +6 -5
- package/src/__tests__/modules/FileDrive/MarkdownFormat.test.tsx +58 -0
- package/src/__tests__/modules/FramePreview/FramePreview.test.tsx +40 -39
- package/src/__tests__/modules/FramePreview/HeadingsOverlay/HeadingsOverlay.test.tsx +11 -11
- package/src/__tests__/modules/Settings/Integrations/Integrations.test.tsx +2 -2
- package/src/__tests__/modules/Settings/Social/Social.test.tsx +4 -3
- package/src/__tests__/modules/Sites/Sites.test.tsx +5 -4
- package/src/__tests__/modules/Sites/SitesList/ListView/BulkHeader/BulkHeader.test.tsx +2 -2
- package/src/__tests__/modules/Sites/SitesList/SitesList.test.tsx +7 -6
- package/src/__tests__/modules/Sites/SitesList/WelcomeModal/DataStep/DataStep.test.tsx +6 -6
- package/src/__tests__/modules/Sites/SitesList/WelcomeModal/FinalStep/FinalStep.test.tsx +4 -4
- package/src/__tests__/modules/Sites/SitesList/WelcomeModal/ImageStep/CropView/CropView.test.tsx +3 -3
- package/src/__tests__/modules/Sites/SitesList/WelcomeModal/ImageStep/ImageStep.test.tsx +9 -5
- package/src/__tests__/modules/Sites/SitesList/WelcomeModal/ImageStep/UploadView/UploadView.test.tsx +8 -6
- package/src/__tests__/modules/Sites/SitesList/WelcomeModal/TimezoneStep/TimezoneStep.test.tsx +7 -7
- package/src/__tests__/modules/Sites/SitesList/WelcomeModal/WelcomeModal.test.tsx +1 -1
- package/src/__tests__/modules/Sites/SitesList/WelcomeModal/WelcomeStep/WelcomeStep.test.tsx +3 -3
- package/src/__tests__/modules/Users/Roles/BulkHeader/BulkHeader.test.tsx +3 -3
- package/src/__tests__/modules/Users/Roles/Roles.test.tsx +11 -10
- package/src/__tests__/modules/Users/UserCreate/SiteItem/RolesModal/RoleItem/RoleItem.test.tsx +3 -3
- package/src/__tests__/modules/Users/UserCreate/SiteItem/RolesModal/RolesModal.test.tsx +3 -3
- package/src/__tests__/modules/Users/UserCreate/SiteItem/SiteItem.test.tsx +3 -3
- package/src/__tests__/modules/Users/UserCreate/UserCreate.test.tsx +6 -5
- package/src/__tests__/modules/Users/UserList/UserItem/UserItem.test.tsx +9 -9
- package/src/__tests__/modules/Users/UserList/UserList.test.tsx +4 -4
- package/src/components/Flag/components/index.ts +30 -0
- package/src/components/Flag/index.tsx +3 -5
- package/src/components/Icon/components/index.ts +229 -0
- package/src/components/Icon/index.tsx +3 -7
- package/src/constants/index.ts +1 -1
- package/src/helpers/files.tsx +2 -0
- package/src/modules/FileDrive/FileFilters/Type/index.tsx +1 -0
- package/tsconfig.json +1 -1
- package/config/jest/cssTransform.js +0 -14
- package/config/jest/fileMock.js +0 -1
- package/config/jest/fileTransform.js +0 -40
- package/config/jest/reactEasyCropMock.js +0 -15
- package/config/jest/reactTimezoneMock.js +0 -13
- package/config/jest/setup.js +0 -31
- package/config/jest/styleMock.js +0 -1
- /package/config/{jest/test-utils.js → tests/test-utils.jsx} +0 -0
- /package/src/components/Flag/components/{Ca_ES.js → Ca_ES.jsx} +0 -0
- /package/src/components/Flag/components/{De_DE.js → De_DE.jsx} +0 -0
- /package/src/components/Flag/components/{En_GB.js → En_GB.jsx} +0 -0
- /package/src/components/Flag/components/{Es_ES.js → Es_ES.jsx} +0 -0
- /package/src/components/Flag/components/{Eu_ES.js → Eu_ES.jsx} +0 -0
- /package/src/components/Flag/components/{Fr_FR.js → Fr_FR.jsx} +0 -0
- /package/src/components/Flag/components/{It_IT.js → It_IT.jsx} +0 -0
- /package/src/components/Flag/components/{Pt_PT.js → Pt_PT.jsx} +0 -0
- /package/src/components/Icon/components/{Active.js → Active.jsx} +0 -0
- /package/src/components/Icon/components/{Add.js → Add.jsx} +0 -0
- /package/src/components/Icon/components/{AddCircle.js → AddCircle.jsx} +0 -0
- /package/src/components/Icon/components/{Alert.js → Alert.jsx} +0 -0
- /package/src/components/Icon/components/{AlignLeft.js → AlignLeft.jsx} +0 -0
- /package/src/components/Icon/components/{Back.js → Back.jsx} +0 -0
- /package/src/components/Icon/components/{BulletList.js → BulletList.jsx} +0 -0
- /package/src/components/Icon/components/{Button.js → Button.jsx} +0 -0
- /package/src/components/Icon/components/{Calendar.js → Calendar.jsx} +0 -0
- /package/src/components/Icon/components/{CancelEvent.js → CancelEvent.jsx} +0 -0
- /package/src/components/Icon/components/{Category.js → Category.jsx} +0 -0
- /package/src/components/Icon/components/{Change.js → Change.jsx} +0 -0
- /package/src/components/Icon/components/{Close.js → Close.jsx} +0 -0
- /package/src/components/Icon/components/{ClosePanel.js → ClosePanel.jsx} +0 -0
- /package/src/components/Icon/components/{CodeBody.js → CodeBody.jsx} +0 -0
- /package/src/components/Icon/components/{CodeHead.js → CodeHead.jsx} +0 -0
- /package/src/components/Icon/components/{CodeHeadBody.js → CodeHeadBody.jsx} +0 -0
- /package/src/components/Icon/components/{Collapsed.js → Collapsed.jsx} +0 -0
- /package/src/components/Icon/components/{ColorPicker.js → ColorPicker.jsx} +0 -0
- /package/src/components/Icon/components/{Compose.js → Compose.jsx} +0 -0
- /package/src/components/Icon/components/{Copy.js → Copy.jsx} +0 -0
- /package/src/components/Icon/components/{Copy2.js → Copy2.jsx} +0 -0
- /package/src/components/Icon/components/{Data.js → Data.jsx} +0 -0
- /package/src/components/Icon/components/{DataAdd.js → DataAdd.jsx} +0 -0
- /package/src/components/Icon/components/{Deactivate.js → Deactivate.jsx} +0 -0
- /package/src/components/Icon/components/{Delete.js → Delete.jsx} +0 -0
- /package/src/components/Icon/components/{Desktop.js → Desktop.jsx} +0 -0
- /package/src/components/Icon/components/{Disabled.js → Disabled.jsx} +0 -0
- /package/src/components/Icon/components/{Done.js → Done.jsx} +0 -0
- /package/src/components/Icon/components/{DownArrow.js → DownArrow.jsx} +0 -0
- /package/src/components/Icon/components/{Download.js → Download.jsx} +0 -0
- /package/src/components/Icon/components/{Drag.js → Drag.jsx} +0 -0
- /package/src/components/Icon/components/{Duplicate.js → Duplicate.jsx} +0 -0
- /package/src/components/Icon/components/{Edit.js → Edit.jsx} +0 -0
- /package/src/components/Icon/components/{Empty.js → Empty.jsx} +0 -0
- /package/src/components/Icon/components/{EmptyCheck.js → EmptyCheck.jsx} +0 -0
- /package/src/components/Icon/components/{Extend.js → Extend.jsx} +0 -0
- /package/src/components/Icon/components/{File.js → File.jsx} +0 -0
- /package/src/components/Icon/components/{Filter.js → Filter.jsx} +0 -0
- /package/src/components/Icon/components/{Form.js → Form.jsx} +0 -0
- /package/src/components/Icon/components/{FullArrowDown.js → FullArrowDown.jsx} +0 -0
- /package/src/components/Icon/components/{FullArrowLeft.js → FullArrowLeft.jsx} +0 -0
- /package/src/components/Icon/components/{FullArrowRight.js → FullArrowRight.jsx} +0 -0
- /package/src/components/Icon/components/{FullArrowUp.js → FullArrowUp.jsx} +0 -0
- /package/src/components/Icon/components/{Grid.js → Grid.jsx} +0 -0
- /package/src/components/Icon/components/{Grid2.js → Grid2.jsx} +0 -0
- /package/src/components/Icon/components/{GriddoLogo.js → GriddoLogo.jsx} +0 -0
- /package/src/components/Icon/components/{HeroCard.js → HeroCard.jsx} +0 -0
- /package/src/components/Icon/components/{Hide.js → Hide.jsx} +0 -0
- /package/src/components/Icon/components/{History.js → History.jsx} +0 -0
- /package/src/components/Icon/components/{Home.js → Home.jsx} +0 -0
- /package/src/components/Icon/components/{Ia.js → Ia.jsx} +0 -0
- /package/src/components/Icon/components/{Image.js → Image.jsx} +0 -0
- /package/src/components/Icon/components/{Info.js → Info.jsx} +0 -0
- /package/src/components/Icon/components/{Laptop.js → Laptop.jsx} +0 -0
- /package/src/components/Icon/components/{LeftArrow.js → LeftArrow.jsx} +0 -0
- /package/src/components/Icon/components/{Link.js → Link.jsx} +0 -0
- /package/src/components/Icon/components/{Lock.js → Lock.jsx} +0 -0
- /package/src/components/Icon/components/{Log.js → Log.jsx} +0 -0
- /package/src/components/Icon/components/{Map.js → Map.jsx} +0 -0
- /package/src/components/Icon/components/{Menu.js → Menu.jsx} +0 -0
- /package/src/components/Icon/components/{Microsoft.js → Microsoft.jsx} +0 -0
- /package/src/components/Icon/components/{Modified.js → Modified.jsx} +0 -0
- /package/src/components/Icon/components/{Modules.js → Modules.jsx} +0 -0
- /package/src/components/Icon/components/{More.js → More.jsx} +0 -0
- /package/src/components/Icon/components/{NewFolder.js → NewFolder.jsx} +0 -0
- /package/src/components/Icon/components/{Offline.js → Offline.jsx} +0 -0
- /package/src/components/Icon/components/{OfflinePending.js → OfflinePending.jsx} +0 -0
- /package/src/components/Icon/components/{OpenOutside.js → OpenOutside.jsx} +0 -0
- /package/src/components/Icon/components/{OpenPanel.js → OpenPanel.jsx} +0 -0
- /package/src/components/Icon/components/{OutOfSection.js → OutOfSection.jsx} +0 -0
- /package/src/components/Icon/components/{Page.js → Page.jsx} +0 -0
- /package/src/components/Icon/components/{Party.js → Party.jsx} +0 -0
- /package/src/components/Icon/components/{Paste.js → Paste.jsx} +0 -0
- /package/src/components/Icon/components/{Phone.js → Phone.jsx} +0 -0
- /package/src/components/Icon/components/{PhotoLibrary.js → PhotoLibrary.jsx} +0 -0
- /package/src/components/Icon/components/{Power.js → Power.jsx} +0 -0
- /package/src/components/Icon/components/{Preview.js → Preview.jsx} +0 -0
- /package/src/components/Icon/components/{Project.js → Project.jsx} +0 -0
- /package/src/components/Icon/components/{QrCode.js → QrCode.jsx} +0 -0
- /package/src/components/Icon/components/{Question.js → Question.jsx} +0 -0
- /package/src/components/Icon/components/{Refresh.js → Refresh.jsx} +0 -0
- /package/src/components/Icon/components/{Republish.js → Republish.jsx} +0 -0
- /package/src/components/Icon/components/{RightArrow.js → RightArrow.jsx} +0 -0
- /package/src/components/Icon/components/{Scheduled.js → Scheduled.jsx} +0 -0
- /package/src/components/Icon/components/{Search.js → Search.jsx} +0 -0
- /package/src/components/Icon/components/{SendEmail.js → SendEmail.jsx} +0 -0
- /package/src/components/Icon/components/{Settings.js → Settings.jsx} +0 -0
- /package/src/components/Icon/components/{Share.js → Share.jsx} +0 -0
- /package/src/components/Icon/components/{Subsection.js → Subsection.jsx} +0 -0
- /package/src/components/Icon/components/{Success.js → Success.jsx} +0 -0
- /package/src/components/Icon/components/{SuccessSolid.js → SuccessSolid.jsx} +0 -0
- /package/src/components/Icon/components/{Sync.js → Sync.jsx} +0 -0
- /package/src/components/Icon/components/{Tablet.js → Tablet.jsx} +0 -0
- /package/src/components/Icon/components/{Translate.js → Translate.jsx} +0 -0
- /package/src/components/Icon/components/{Unlink.js → Unlink.jsx} +0 -0
- /package/src/components/Icon/components/{UpArrow.js → UpArrow.jsx} +0 -0
- /package/src/components/Icon/components/{UploadFile.js → UploadFile.jsx} +0 -0
- /package/src/components/Icon/components/{UploadPending.js → UploadPending.jsx} +0 -0
- /package/src/components/Icon/components/{UrlLink.js → UrlLink.jsx} +0 -0
- /package/src/components/Icon/components/{User.js → User.jsx} +0 -0
- /package/src/components/Icon/components/{Users.js → Users.jsx} +0 -0
- /package/src/components/Icon/components/{Video.js → Video.jsx} +0 -0
- /package/src/components/Icon/components/{View.js → View.jsx} +0 -0
- /package/src/components/Icon/components/{Warning.js → Warning.jsx} +0 -0
- /package/src/components/Icon/components/{Web.js → Web.jsx} +0 -0
- /package/src/components/Icon/components/{Working.js → Working.jsx} +0 -0
- /package/src/components/Loader/components/{Circle.js → Circle.jsx} +0 -0
- /package/src/components/Loader/components/{Dots.js → Dots.jsx} +0 -0
- /package/src/components/Loader/components/{SmallCircle.js → SmallCircle.jsx} +0 -0
|
@@ -45,7 +45,7 @@ describe("MenuItem component rendering", () => {
|
|
|
45
45
|
it("should render with extendend action visible", () => {
|
|
46
46
|
const defaultProps: IMenuItemProps = {
|
|
47
47
|
children: <div>Item</div>,
|
|
48
|
-
extendedAction: { icon: "delete", action:
|
|
48
|
+
extendedAction: { icon: "delete", action: vi.fn(), onlyOnHover: false },
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
render(
|
|
@@ -63,7 +63,7 @@ describe("MenuItem component rendering", () => {
|
|
|
63
63
|
it("should render with extendend action not visible", () => {
|
|
64
64
|
const defaultProps: IMenuItemProps = {
|
|
65
65
|
children: <div>Item</div>,
|
|
66
|
-
extendedAction: { icon: "delete", action:
|
|
66
|
+
extendedAction: { icon: "delete", action: vi.fn(), onlyOnHover: true },
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
render(
|
|
@@ -81,7 +81,7 @@ describe("MenuItem component rendering", () => {
|
|
|
81
81
|
it("should render with extendend action not visible if onlyOnHover is undefined", () => {
|
|
82
82
|
const defaultProps: IMenuItemProps = {
|
|
83
83
|
children: <div>Item</div>,
|
|
84
|
-
extendedAction: { icon: "delete", action:
|
|
84
|
+
extendedAction: { icon: "delete", action: vi.fn() },
|
|
85
85
|
};
|
|
86
86
|
|
|
87
87
|
render(
|
|
@@ -99,7 +99,7 @@ describe("MenuItem component rendering", () => {
|
|
|
99
99
|
|
|
100
100
|
describe("component events", () => {
|
|
101
101
|
test("onClick is been called", () => {
|
|
102
|
-
const onClickMock =
|
|
102
|
+
const onClickMock = vi.fn();
|
|
103
103
|
const defaultProps: IMenuItemProps = {
|
|
104
104
|
children: <div>Item</div>,
|
|
105
105
|
onClick: onClickMock,
|
|
@@ -118,7 +118,7 @@ describe("component events", () => {
|
|
|
118
118
|
});
|
|
119
119
|
|
|
120
120
|
test("extended action is called", async () => {
|
|
121
|
-
const actionMock =
|
|
121
|
+
const actionMock = vi.fn();
|
|
122
122
|
const defaultProps: IMenuItemProps = {
|
|
123
123
|
children: <div>Item</div>,
|
|
124
124
|
extendedAction: { icon: "delete", action: actionMock, onlyOnHover: false },
|
|
@@ -14,7 +14,7 @@ describe("Modal component rendering", () => {
|
|
|
14
14
|
const defaultProps: IModalProps = {
|
|
15
15
|
children: <div>the children</div>,
|
|
16
16
|
isOpen: true,
|
|
17
|
-
hide:
|
|
17
|
+
hide: vi.fn(),
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
render(
|
|
@@ -33,7 +33,7 @@ describe("Modal component rendering", () => {
|
|
|
33
33
|
const defaultProps: IModalProps = {
|
|
34
34
|
children: <div>the children</div>,
|
|
35
35
|
isOpen: false,
|
|
36
|
-
hide:
|
|
36
|
+
hide: vi.fn(),
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
render(
|
|
@@ -51,7 +51,7 @@ describe("Modal component rendering", () => {
|
|
|
51
51
|
const defaultProps: IModalProps = {
|
|
52
52
|
children: <div>the children</div>,
|
|
53
53
|
isOpen: true,
|
|
54
|
-
hide:
|
|
54
|
+
hide: vi.fn(),
|
|
55
55
|
title: titleText,
|
|
56
56
|
};
|
|
57
57
|
|
|
@@ -70,10 +70,10 @@ describe("Modal component rendering", () => {
|
|
|
70
70
|
const defaultProps: IModalProps = {
|
|
71
71
|
children: <div>the children</div>,
|
|
72
72
|
isOpen: true,
|
|
73
|
-
hide:
|
|
73
|
+
hide: vi.fn(),
|
|
74
74
|
mainAction: {
|
|
75
75
|
title: buttonText,
|
|
76
|
-
onClick:
|
|
76
|
+
onClick: vi.fn(),
|
|
77
77
|
},
|
|
78
78
|
};
|
|
79
79
|
|
|
@@ -92,10 +92,10 @@ describe("Modal component rendering", () => {
|
|
|
92
92
|
const defaultProps: IModalProps = {
|
|
93
93
|
children: <div>the children</div>,
|
|
94
94
|
isOpen: true,
|
|
95
|
-
hide:
|
|
95
|
+
hide: vi.fn(),
|
|
96
96
|
mainAction: {
|
|
97
97
|
title: buttonText,
|
|
98
|
-
onClick:
|
|
98
|
+
onClick: vi.fn(),
|
|
99
99
|
disabled: true,
|
|
100
100
|
},
|
|
101
101
|
};
|
|
@@ -116,10 +116,10 @@ describe("Modal component rendering", () => {
|
|
|
116
116
|
const defaultProps: IModalProps = {
|
|
117
117
|
children: <div>the children</div>,
|
|
118
118
|
isOpen: true,
|
|
119
|
-
hide:
|
|
119
|
+
hide: vi.fn(),
|
|
120
120
|
secondaryAction: {
|
|
121
121
|
title: buttonText,
|
|
122
|
-
onClick:
|
|
122
|
+
onClick: vi.fn(),
|
|
123
123
|
},
|
|
124
124
|
};
|
|
125
125
|
|
|
@@ -137,7 +137,7 @@ describe("Modal component rendering", () => {
|
|
|
137
137
|
const defaultProps: IModalProps = {
|
|
138
138
|
children: <div>the children</div>,
|
|
139
139
|
isOpen: true,
|
|
140
|
-
hide:
|
|
140
|
+
hide: vi.fn(),
|
|
141
141
|
overflow: "hidden",
|
|
142
142
|
};
|
|
143
143
|
|
|
@@ -157,7 +157,7 @@ describe("Modal component rendering", () => {
|
|
|
157
157
|
const defaultProps: IModalProps = {
|
|
158
158
|
children: <div>the children</div>,
|
|
159
159
|
isOpen: true,
|
|
160
|
-
hide:
|
|
160
|
+
hide: vi.fn(),
|
|
161
161
|
size: "M",
|
|
162
162
|
};
|
|
163
163
|
|
|
@@ -176,7 +176,7 @@ describe("Modal component rendering", () => {
|
|
|
176
176
|
const defaultProps: IModalProps = {
|
|
177
177
|
children: <div>the children</div>,
|
|
178
178
|
isOpen: true,
|
|
179
|
-
hide:
|
|
179
|
+
hide: vi.fn(),
|
|
180
180
|
size: "L",
|
|
181
181
|
};
|
|
182
182
|
|
|
@@ -195,7 +195,7 @@ describe("Modal component rendering", () => {
|
|
|
195
195
|
const defaultProps: IModalProps = {
|
|
196
196
|
children: <div>the children</div>,
|
|
197
197
|
isOpen: true,
|
|
198
|
-
hide:
|
|
198
|
+
hide: vi.fn(),
|
|
199
199
|
size: "XL",
|
|
200
200
|
};
|
|
201
201
|
|
|
@@ -213,7 +213,7 @@ describe("Modal component rendering", () => {
|
|
|
213
213
|
|
|
214
214
|
describe("Modal events", () => {
|
|
215
215
|
it("should call hide on icon button click", () => {
|
|
216
|
-
const hideMock =
|
|
216
|
+
const hideMock = vi.fn();
|
|
217
217
|
const defaultProps: IModalProps = {
|
|
218
218
|
children: <div>the children</div>,
|
|
219
219
|
isOpen: true,
|
|
@@ -233,12 +233,12 @@ describe("Modal events", () => {
|
|
|
233
233
|
});
|
|
234
234
|
|
|
235
235
|
it("should call action on main action button click", () => {
|
|
236
|
-
const actionMock =
|
|
236
|
+
const actionMock = vi.fn();
|
|
237
237
|
const buttonText = "Main Action";
|
|
238
238
|
const defaultProps: IModalProps = {
|
|
239
239
|
children: <div>the children</div>,
|
|
240
240
|
isOpen: true,
|
|
241
|
-
hide:
|
|
241
|
+
hide: vi.fn(),
|
|
242
242
|
mainAction: {
|
|
243
243
|
title: buttonText,
|
|
244
244
|
onClick: actionMock,
|
|
@@ -258,12 +258,12 @@ describe("Modal events", () => {
|
|
|
258
258
|
});
|
|
259
259
|
|
|
260
260
|
it("should not call action on main action button click if disabled", () => {
|
|
261
|
-
const actionMock =
|
|
261
|
+
const actionMock = vi.fn();
|
|
262
262
|
const buttonText = "Main Action";
|
|
263
263
|
const defaultProps: IModalProps = {
|
|
264
264
|
children: <div>the children</div>,
|
|
265
265
|
isOpen: true,
|
|
266
|
-
hide:
|
|
266
|
+
hide: vi.fn(),
|
|
267
267
|
mainAction: {
|
|
268
268
|
title: buttonText,
|
|
269
269
|
onClick: actionMock,
|
|
@@ -284,12 +284,12 @@ describe("Modal events", () => {
|
|
|
284
284
|
});
|
|
285
285
|
|
|
286
286
|
it("should call action on secondary action button click", () => {
|
|
287
|
-
const actionMock =
|
|
287
|
+
const actionMock = vi.fn();
|
|
288
288
|
const buttonText = "Secondary Action";
|
|
289
289
|
const defaultProps: IModalProps = {
|
|
290
290
|
children: <div>the children</div>,
|
|
291
291
|
isOpen: true,
|
|
292
|
-
hide:
|
|
292
|
+
hide: vi.fn(),
|
|
293
293
|
secondaryAction: {
|
|
294
294
|
title: buttonText,
|
|
295
295
|
onClick: actionMock,
|
|
@@ -22,7 +22,7 @@ describe("Nav component rendering", () => {
|
|
|
22
22
|
const defaultProps: INavProps = {
|
|
23
23
|
items,
|
|
24
24
|
current: items[0],
|
|
25
|
-
onClick:
|
|
25
|
+
onClick: vi.fn(),
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
render(
|
|
@@ -40,7 +40,7 @@ describe("Nav component rendering", () => {
|
|
|
40
40
|
const defaultProps: INavProps = {
|
|
41
41
|
items: [],
|
|
42
42
|
current: undefined,
|
|
43
|
-
onClick:
|
|
43
|
+
onClick: vi.fn(),
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
render(
|
|
@@ -162,7 +162,7 @@ describe("Notification component with subnotifications", () => {
|
|
|
162
162
|
|
|
163
163
|
describe("Notification component events", () => {
|
|
164
164
|
it("should call onClick on action button click", () => {
|
|
165
|
-
const onClickMock =
|
|
165
|
+
const onClickMock = vi.fn();
|
|
166
166
|
const defaultProps: INotificationProps = {
|
|
167
167
|
text: "Notification text",
|
|
168
168
|
type: "success",
|
|
@@ -183,7 +183,7 @@ describe("Notification component events", () => {
|
|
|
183
183
|
});
|
|
184
184
|
|
|
185
185
|
it("should call resetError on close and hide notification", () => {
|
|
186
|
-
const resetErrorMock =
|
|
186
|
+
const resetErrorMock = vi.fn();
|
|
187
187
|
const defaultProps: INotificationProps = {
|
|
188
188
|
text: "Notification text",
|
|
189
189
|
type: "success",
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import "jest-styled-components";
|
|
2
1
|
|
|
3
2
|
import Pagination, { type IPaginationProps } from "@ax/components/Pagination";
|
|
4
3
|
import { parseTheme } from "@ax/helpers";
|
|
5
4
|
import globalTheme from "@ax/themes/theme.json";
|
|
6
5
|
|
|
7
6
|
import { cleanup, fireEvent, render, screen } from "@testing-library/react";
|
|
8
|
-
import { mock } from "
|
|
7
|
+
import { mock } from "vitest-mock-extended";
|
|
9
8
|
import { ThemeProvider } from "styled-components";
|
|
10
9
|
|
|
11
10
|
afterEach(cleanup);
|
|
@@ -14,7 +13,7 @@ const defaultProps = mock<IPaginationProps>();
|
|
|
14
13
|
|
|
15
14
|
describe("Pagination component rendering", () => {
|
|
16
15
|
it("should render pagination component", () => {
|
|
17
|
-
const setPageMock =
|
|
16
|
+
const setPageMock = vi.fn();
|
|
18
17
|
defaultProps.currPage = 1;
|
|
19
18
|
defaultProps.itemsPerPage = 10;
|
|
20
19
|
defaultProps.setPage = setPageMock;
|
|
@@ -31,7 +30,7 @@ describe("Pagination component rendering", () => {
|
|
|
31
30
|
});
|
|
32
31
|
|
|
33
32
|
it("should render pagination label when size equals 'S'", () => {
|
|
34
|
-
const setPageMock =
|
|
33
|
+
const setPageMock = vi.fn();
|
|
35
34
|
defaultProps.currPage = 1;
|
|
36
35
|
defaultProps.itemsPerPage = 10;
|
|
37
36
|
defaultProps.setPage = setPageMock;
|
|
@@ -49,7 +48,7 @@ describe("Pagination component rendering", () => {
|
|
|
49
48
|
});
|
|
50
49
|
|
|
51
50
|
it("should render pagination text input when size is undefined", () => {
|
|
52
|
-
const setPageMock =
|
|
51
|
+
const setPageMock = vi.fn();
|
|
53
52
|
defaultProps.currPage = 1;
|
|
54
53
|
defaultProps.itemsPerPage = 10;
|
|
55
54
|
defaultProps.setPage = setPageMock;
|
|
@@ -67,7 +66,7 @@ describe("Pagination component rendering", () => {
|
|
|
67
66
|
});
|
|
68
67
|
|
|
69
68
|
it("should render arrow left disabled when it's first page", () => {
|
|
70
|
-
const setPageMock =
|
|
69
|
+
const setPageMock = vi.fn();
|
|
71
70
|
defaultProps.currPage = 1;
|
|
72
71
|
defaultProps.itemsPerPage = 10;
|
|
73
72
|
defaultProps.setPage = setPageMock;
|
|
@@ -87,7 +86,7 @@ describe("Pagination component rendering", () => {
|
|
|
87
86
|
});
|
|
88
87
|
|
|
89
88
|
it("should render arrow right disabled when it's last page", () => {
|
|
90
|
-
const setPageMock =
|
|
89
|
+
const setPageMock = vi.fn();
|
|
91
90
|
defaultProps.currPage = 2;
|
|
92
91
|
defaultProps.itemsPerPage = 10;
|
|
93
92
|
defaultProps.setPage = setPageMock;
|
|
@@ -109,7 +108,7 @@ describe("Pagination component rendering", () => {
|
|
|
109
108
|
|
|
110
109
|
describe("Pagination component events", () => {
|
|
111
110
|
it("should call setPage when click next page button", () => {
|
|
112
|
-
const setPageMock =
|
|
111
|
+
const setPageMock = vi.fn();
|
|
113
112
|
defaultProps.currPage = 1;
|
|
114
113
|
defaultProps.itemsPerPage = 10;
|
|
115
114
|
defaultProps.setPage = setPageMock;
|
|
@@ -128,7 +127,7 @@ describe("Pagination component events", () => {
|
|
|
128
127
|
});
|
|
129
128
|
|
|
130
129
|
it("should call setPage when click next page button", () => {
|
|
131
|
-
const setPageMock =
|
|
130
|
+
const setPageMock = vi.fn();
|
|
132
131
|
defaultProps.currPage = 1;
|
|
133
132
|
defaultProps.itemsPerPage = 10;
|
|
134
133
|
defaultProps.setPage = setPageMock;
|
|
@@ -147,7 +146,7 @@ describe("Pagination component events", () => {
|
|
|
147
146
|
});
|
|
148
147
|
|
|
149
148
|
it("should call setPage when click prev page button", () => {
|
|
150
|
-
const setPageMock =
|
|
149
|
+
const setPageMock = vi.fn();
|
|
151
150
|
defaultProps.currPage = 2;
|
|
152
151
|
defaultProps.itemsPerPage = 10;
|
|
153
152
|
defaultProps.setPage = setPageMock;
|
|
@@ -166,7 +165,7 @@ describe("Pagination component events", () => {
|
|
|
166
165
|
});
|
|
167
166
|
|
|
168
167
|
it("should call setPage when change input value and blur", () => {
|
|
169
|
-
const setPageMock =
|
|
168
|
+
const setPageMock = vi.fn();
|
|
170
169
|
defaultProps.currPage = 1;
|
|
171
170
|
defaultProps.itemsPerPage = 10;
|
|
172
171
|
defaultProps.setPage = setPageMock;
|
|
@@ -186,7 +185,7 @@ describe("Pagination component events", () => {
|
|
|
186
185
|
});
|
|
187
186
|
|
|
188
187
|
it("should call setPage with 1 when change input value is not a number", () => {
|
|
189
|
-
const setPageMock =
|
|
188
|
+
const setPageMock = vi.fn();
|
|
190
189
|
defaultProps.currPage = 1;
|
|
191
190
|
defaultProps.itemsPerPage = 10;
|
|
192
191
|
defaultProps.setPage = setPageMock;
|
|
@@ -206,7 +205,7 @@ describe("Pagination component events", () => {
|
|
|
206
205
|
});
|
|
207
206
|
|
|
208
207
|
it("shouldn't call setPage when current page is lower than or equal to 1", () => {
|
|
209
|
-
const setPageMock =
|
|
208
|
+
const setPageMock = vi.fn();
|
|
210
209
|
defaultProps.currPage = 1;
|
|
211
210
|
defaultProps.itemsPerPage = 10;
|
|
212
211
|
defaultProps.setPage = setPageMock;
|
|
@@ -224,7 +223,7 @@ describe("Pagination component events", () => {
|
|
|
224
223
|
});
|
|
225
224
|
|
|
226
225
|
it("shouldn't call setPage when current page is greater than or equal to last page", () => {
|
|
227
|
-
const setPageMock =
|
|
226
|
+
const setPageMock = vi.fn();
|
|
228
227
|
defaultProps.currPage = 2;
|
|
229
228
|
defaultProps.itemsPerPage = 10;
|
|
230
229
|
defaultProps.setPage = setPageMock;
|
|
@@ -7,9 +7,8 @@ import globalTheme from "@ax/themes/theme.json";
|
|
|
7
7
|
import { cleanup, fireEvent, render, screen } from "@testing-library/react";
|
|
8
8
|
import { ThemeProvider } from "styled-components";
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
() => (props: any) =>
|
|
10
|
+
vi.mock("@ax/components/ImageDragAndDrop", () => ({
|
|
11
|
+
default: (props: any) =>
|
|
13
12
|
React.createElement(
|
|
14
13
|
"div",
|
|
15
14
|
{
|
|
@@ -18,14 +17,14 @@ jest.mock(
|
|
|
18
17
|
},
|
|
19
18
|
React.createElement("button", { type: "button" }, "Upload Mock"),
|
|
20
19
|
),
|
|
21
|
-
);
|
|
20
|
+
}));
|
|
22
21
|
|
|
23
22
|
afterEach(cleanup);
|
|
24
23
|
|
|
25
24
|
const renderProfileImage = (props = {}) =>
|
|
26
25
|
render(
|
|
27
26
|
<ThemeProvider theme={parseTheme(globalTheme)}>
|
|
28
|
-
<ProfileImage handleImage={
|
|
27
|
+
<ProfileImage handleImage={vi.fn()} size={96} {...props} />
|
|
29
28
|
</ThemeProvider>,
|
|
30
29
|
);
|
|
31
30
|
|
|
@@ -91,7 +90,7 @@ describe("ProfileImage modal", () => {
|
|
|
91
90
|
|
|
92
91
|
describe("ProfileImage upload", () => {
|
|
93
92
|
it("should call handleImage when image is uploaded", () => {
|
|
94
|
-
const handleImage =
|
|
93
|
+
const handleImage = vi.fn();
|
|
95
94
|
renderProfileImage({ handleImage });
|
|
96
95
|
|
|
97
96
|
const wrapper = screen.getByTestId("profile-image-wrapper");
|
|
@@ -104,7 +103,7 @@ describe("ProfileImage upload", () => {
|
|
|
104
103
|
});
|
|
105
104
|
|
|
106
105
|
it("should close modal after successful upload", () => {
|
|
107
|
-
const handleImage =
|
|
106
|
+
const handleImage = vi.fn();
|
|
108
107
|
renderProfileImage({ handleImage });
|
|
109
108
|
|
|
110
109
|
const wrapper = screen.getByTestId("profile-image-wrapper");
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { MockedFunction } from "vitest";
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
|
|
3
4
|
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import { mock } from "
|
|
5
|
+
import { mock } from "vitest-mock-extended";
|
|
5
6
|
import { render, cleanup, screen, fireEvent } from "@testing-library/react";
|
|
6
7
|
import { parseTheme } from "@ax/helpers";
|
|
7
8
|
import "@testing-library/jest-dom";
|
|
@@ -58,7 +59,7 @@ describe("ReorderArrows component rendering", () => {
|
|
|
58
59
|
|
|
59
60
|
describe("ReorderArrows component events trigger", () => {
|
|
60
61
|
it("should trigger the handleDownClick", () => {
|
|
61
|
-
const handleDownClickMock = defaultProps.handleDownClick as
|
|
62
|
+
const handleDownClickMock = defaultProps.handleDownClick as MockedFunction<(value: any) => void>;
|
|
62
63
|
defaultProps.index = 0;
|
|
63
64
|
defaultProps.listLength = 10;
|
|
64
65
|
|
|
@@ -77,7 +78,7 @@ describe("ReorderArrows component events trigger", () => {
|
|
|
77
78
|
});
|
|
78
79
|
|
|
79
80
|
it("should trigger the handleUpClick", () => {
|
|
80
|
-
const handleUpClickMock = defaultProps.handleUpClick as
|
|
81
|
+
const handleUpClickMock = defaultProps.handleUpClick as MockedFunction<(value: any) => void>;
|
|
81
82
|
defaultProps.index = 9;
|
|
82
83
|
defaultProps.listLength = 10;
|
|
83
84
|
render(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MockedFunction } from "vitest";
|
|
1
2
|
import React, { useRef } from "react";
|
|
2
3
|
|
|
3
4
|
import { ThemeProvider } from "styled-components";
|
|
@@ -11,23 +12,21 @@ import globalTheme from "@ax/themes/theme.json";
|
|
|
11
12
|
afterEach(cleanup);
|
|
12
13
|
|
|
13
14
|
beforeEach(() => {
|
|
14
|
-
global.ResizeObserver =
|
|
15
|
-
observe:
|
|
16
|
-
|
|
17
|
-
disconnect: jest.fn(),
|
|
18
|
-
}));
|
|
15
|
+
global.ResizeObserver = vi.fn().mockImplementation(function () {
|
|
16
|
+
return { observe: vi.fn(), unobserve: vi.fn(), disconnect: vi.fn() };
|
|
17
|
+
});
|
|
19
18
|
});
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
const originReact =
|
|
23
|
-
const mUseRef =
|
|
20
|
+
vi.mock("react", async () => {
|
|
21
|
+
const originReact = await vi.importActual("react");
|
|
22
|
+
const mUseRef = vi.fn();
|
|
24
23
|
return {
|
|
25
24
|
...originReact,
|
|
26
25
|
useRef: mUseRef,
|
|
27
26
|
};
|
|
28
27
|
});
|
|
29
28
|
|
|
30
|
-
const useMockRef = useRef as
|
|
29
|
+
const useMockRef = useRef as MockedFunction<typeof useRef>;
|
|
31
30
|
|
|
32
31
|
describe("ResizePanel component rendering", () => {
|
|
33
32
|
it("should render the component with fixed panel", () => {
|
|
@@ -103,7 +102,7 @@ describe("ResizePanel mouse events", () => {
|
|
|
103
102
|
const rightPanel = screen.getByTestId("right-panel");
|
|
104
103
|
expect(rightPanel).toBeTruthy();
|
|
105
104
|
|
|
106
|
-
|
|
105
|
+
vi.spyOn(rightPanel, "offsetWidth", "get").mockReturnValue(344);
|
|
107
106
|
|
|
108
107
|
// Forzar un re-render para que ResizePanel use el ancho mockeado
|
|
109
108
|
// (React mide en requestAnimationFrame, así que usamos act)
|
|
@@ -145,7 +144,7 @@ describe("ResizePanel mouse events", () => {
|
|
|
145
144
|
const rightPanel = screen.getByTestId("right-panel");
|
|
146
145
|
expect(rightPanel).toBeTruthy();
|
|
147
146
|
|
|
148
|
-
|
|
147
|
+
vi.spyOn(rightPanel, "offsetWidth", "get").mockReturnValue(344);
|
|
149
148
|
|
|
150
149
|
// Forzar un re-render para que ResizePanel use el ancho mockeado
|
|
151
150
|
// (React mide en requestAnimationFrame, así que usamos act)
|
package/src/__tests__/components/RestrictionsModal/CurrentAccessList/CurrentAccessList.test.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Mock } from "vitest";
|
|
1
2
|
import { parseTheme } from "@ax/helpers";
|
|
2
3
|
|
|
3
4
|
import { cleanup, fireEvent, render, screen } from "@testing-library/react";
|
|
@@ -8,9 +9,9 @@ import CurrentAccessList from "@ax/components/RestrictionsModal/CurrentAccessLis
|
|
|
8
9
|
import globalTheme from "@ax/themes/theme.json";
|
|
9
10
|
import type { IUser } from "@ax/types";
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
...
|
|
13
|
-
useSelector:
|
|
12
|
+
vi.mock("react-redux", async () => ({
|
|
13
|
+
...(await vi.importActual("react-redux")),
|
|
14
|
+
useSelector: vi.fn((selector) => {
|
|
14
15
|
const mockState = {
|
|
15
16
|
users: {
|
|
16
17
|
roles: [
|
|
@@ -28,7 +29,7 @@ afterEach(cleanup);
|
|
|
28
29
|
const defaultProps: {
|
|
29
30
|
restrictionType: "users" | "roles";
|
|
30
31
|
currentAccessGrants: { users: number[]; roles: number[] };
|
|
31
|
-
onEdit:
|
|
32
|
+
onEdit: Mock;
|
|
32
33
|
users: IUser[];
|
|
33
34
|
} = {
|
|
34
35
|
restrictionType: "users",
|
|
@@ -36,7 +37,7 @@ const defaultProps: {
|
|
|
36
37
|
users: [1, 2],
|
|
37
38
|
roles: [],
|
|
38
39
|
},
|
|
39
|
-
onEdit:
|
|
40
|
+
onEdit: vi.fn(),
|
|
40
41
|
users: [
|
|
41
42
|
{
|
|
42
43
|
id: 1,
|
|
@@ -144,7 +145,7 @@ describe("CurrentAccessList component rendering", () => {
|
|
|
144
145
|
|
|
145
146
|
describe("CurrentAccessList component events", () => {
|
|
146
147
|
it("should call onEdit when Manage User Access button is clicked", () => {
|
|
147
|
-
const onEditMock =
|
|
148
|
+
const onEditMock = vi.fn();
|
|
148
149
|
|
|
149
150
|
renderComponent({
|
|
150
151
|
...defaultProps,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Mock } from "vitest";
|
|
1
2
|
import React from "react";
|
|
2
3
|
|
|
3
4
|
import { ThemeProvider } from "styled-components";
|
|
@@ -12,14 +13,14 @@ afterEach(cleanup);
|
|
|
12
13
|
|
|
13
14
|
const defaultProps: {
|
|
14
15
|
restrictionType: "users" | "roles";
|
|
15
|
-
onRestrictionTypeChange:
|
|
16
|
-
onCancel:
|
|
17
|
-
onNext:
|
|
16
|
+
onRestrictionTypeChange: Mock;
|
|
17
|
+
onCancel: Mock;
|
|
18
|
+
onNext: Mock;
|
|
18
19
|
} = {
|
|
19
20
|
restrictionType: "users",
|
|
20
|
-
onRestrictionTypeChange:
|
|
21
|
-
onCancel:
|
|
22
|
-
onNext:
|
|
21
|
+
onRestrictionTypeChange: vi.fn(),
|
|
22
|
+
onCancel: vi.fn(),
|
|
23
|
+
onNext: vi.fn(),
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
const renderComponent = (props = defaultProps) =>
|
|
@@ -81,7 +82,7 @@ describe("OptionsStep component rendering", () => {
|
|
|
81
82
|
|
|
82
83
|
describe("OptionsStep component events", () => {
|
|
83
84
|
it("should call onRestrictionTypeChange when users option is clicked", () => {
|
|
84
|
-
const onRestrictionTypeChangeMock =
|
|
85
|
+
const onRestrictionTypeChangeMock = vi.fn();
|
|
85
86
|
|
|
86
87
|
renderComponent({
|
|
87
88
|
...defaultProps,
|
|
@@ -97,7 +98,7 @@ describe("OptionsStep component events", () => {
|
|
|
97
98
|
});
|
|
98
99
|
|
|
99
100
|
it("should call onRestrictionTypeChange when roles option is clicked", () => {
|
|
100
|
-
const onRestrictionTypeChangeMock =
|
|
101
|
+
const onRestrictionTypeChangeMock = vi.fn();
|
|
101
102
|
|
|
102
103
|
renderComponent({
|
|
103
104
|
...defaultProps,
|
|
@@ -113,7 +114,7 @@ describe("OptionsStep component events", () => {
|
|
|
113
114
|
});
|
|
114
115
|
|
|
115
116
|
it("should call onCancel when Cancel button is clicked", () => {
|
|
116
|
-
const onCancelMock =
|
|
117
|
+
const onCancelMock = vi.fn();
|
|
117
118
|
|
|
118
119
|
renderComponent({
|
|
119
120
|
...defaultProps,
|
|
@@ -127,7 +128,7 @@ describe("OptionsStep component events", () => {
|
|
|
127
128
|
});
|
|
128
129
|
|
|
129
130
|
it("should call onNext when Next button is clicked", () => {
|
|
130
|
-
const onNextMock =
|
|
131
|
+
const onNextMock = vi.fn();
|
|
131
132
|
|
|
132
133
|
renderComponent({
|
|
133
134
|
...defaultProps,
|
|
@@ -141,7 +142,7 @@ describe("OptionsStep component events", () => {
|
|
|
141
142
|
});
|
|
142
143
|
|
|
143
144
|
it("should toggle between users and roles selections", () => {
|
|
144
|
-
const onRestrictionTypeChangeMock =
|
|
145
|
+
const onRestrictionTypeChangeMock = vi.fn();
|
|
145
146
|
|
|
146
147
|
renderComponent({
|
|
147
148
|
...defaultProps,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Mock } from "vitest";
|
|
1
2
|
import { cleanup, fireEvent, render, screen } from "@testing-library/react";
|
|
2
3
|
import { ThemeProvider } from "styled-components";
|
|
3
4
|
import "@testing-library/jest-dom";
|
|
@@ -7,13 +8,13 @@ import { parseTheme } from "@ax/helpers";
|
|
|
7
8
|
import globalTheme from "@ax/themes/theme.json";
|
|
8
9
|
import type { PageAccessGrantsSummary } from "@ax/types";
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
fetchUsers:
|
|
11
|
+
vi.mock("@ax/components/RestrictionsModal/utils", async () => ({
|
|
12
|
+
fetchUsers: vi.fn().mockResolvedValue([]),
|
|
12
13
|
}));
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
...
|
|
16
|
-
useSelector:
|
|
15
|
+
vi.mock("react-redux", async () => ({
|
|
16
|
+
...(await vi.importActual("react-redux")),
|
|
17
|
+
useSelector: vi.fn((selector) => {
|
|
17
18
|
const mockState = {
|
|
18
19
|
sites: {
|
|
19
20
|
currentSiteInfo: { id: 1 },
|
|
@@ -34,15 +35,15 @@ afterEach(cleanup);
|
|
|
34
35
|
|
|
35
36
|
const defaultProps: {
|
|
36
37
|
isOpen: boolean;
|
|
37
|
-
toggleModal:
|
|
38
|
+
toggleModal: Mock;
|
|
38
39
|
currentAccessGrants: PageAccessGrantsSummary | undefined;
|
|
39
|
-
onUpdateAccessGrants:
|
|
40
|
+
onUpdateAccessGrants: Mock;
|
|
40
41
|
isSaving: boolean;
|
|
41
42
|
} = {
|
|
42
43
|
isOpen: false,
|
|
43
|
-
toggleModal:
|
|
44
|
+
toggleModal: vi.fn(),
|
|
44
45
|
currentAccessGrants: undefined,
|
|
45
|
-
onUpdateAccessGrants:
|
|
46
|
+
onUpdateAccessGrants: vi.fn().mockResolvedValue(undefined),
|
|
46
47
|
isSaving: false,
|
|
47
48
|
};
|
|
48
49
|
|
|
@@ -102,7 +103,7 @@ describe("RestrictionsModal component navigation", () => {
|
|
|
102
103
|
});
|
|
103
104
|
|
|
104
105
|
it("should close modal when Cancel button is clicked", () => {
|
|
105
|
-
const toggleModalMock =
|
|
106
|
+
const toggleModalMock = vi.fn();
|
|
106
107
|
|
|
107
108
|
renderComponent({
|
|
108
109
|
...defaultProps,
|