@wise/dynamic-flow-client 3.5.0-experimental-63c768d → 3.5.1-experimental-ccbce45
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/build/common/errorBoundary/ErrorBoundaryAlert.js +1 -1
- package/build/common/httpClientContext/HttpClientContext.js +2 -13
- package/build/common/makeHttpClient/makeHttpClient.spec.js +10 -10
- package/build/common/messages/external-confirmation.messages.js +5 -5
- package/build/common/messages/generic-error.messages.js +4 -4
- package/build/common/messages/help.messages.js +2 -2
- package/build/common/messages/multi-file-upload.messages.js +4 -4
- package/build/common/messages/multi-select.messages.js +2 -2
- package/build/common/messages/paragraph.messages.js +3 -3
- package/build/common/messages/repeatable.messages.js +5 -5
- package/build/common/messages/validation.array.messages.js +3 -3
- package/build/common/messages/validation.messages.js +11 -11
- package/build/i18n/index.js +1 -1
- package/build/legacy/common/constants/DateMode.js +1 -1
- package/build/legacy/common/constants/FormControlType.js +1 -1
- package/build/legacy/common/constants/MonthFormat.js +1 -1
- package/build/legacy/common/constants/Size.js +1 -1
- package/build/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +3 -14
- package/build/legacy/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +3 -1
- package/build/legacy/common/contexts/eventsContext/EventsContext.js +2 -2
- package/build/legacy/common/contexts/eventsContext/EventsContext.spec.js +1 -12
- package/build/legacy/common/contexts/featureContext/FeatureContext.js +1 -12
- package/build/legacy/common/contexts/featureContext/FeatureContext.spec.js +4 -15
- package/build/legacy/common/contexts/logContext/LogContext.js +2 -2
- package/build/legacy/common/contexts/logContext/LogContext.spec.js +1 -12
- package/build/legacy/common/hooks/useExternal/useExternal.spec.js +6 -6
- package/build/legacy/common/hooks/useExternalStepPolling/useExternalStepPolling.js +3 -2
- package/build/legacy/common/hooks/usePersistAsync/usePersistAsync.js +1 -1
- package/build/legacy/common/hooks/usePolling/usePolling.js +4 -2
- package/build/legacy/common/hooks/useStepPolling/useStepPolling.js +5 -3
- package/build/legacy/common/hooks/useStepPolling/useStepPolling.spec.js +4 -4
- package/build/legacy/common/messages.js +2 -2
- package/build/legacy/common/utils/file-utils.spec.js +4 -4
- package/build/legacy/common/utils/mobile-utils.spec.js +1 -1
- package/build/legacy/common/utils/schema-utils.js +2 -2
- package/build/legacy/common/validators/models/model-utils.spec.js +7 -7
- package/build/legacy/common/validators/models/model-validators.js +2 -2
- package/build/legacy/common/validators/models/model-validators.spec.js +54 -54
- package/build/legacy/common/validators/schemas/schema-validators.js +1 -1
- package/build/legacy/common/validators/schemas/schema-validators.spec.js +20 -20
- package/build/legacy/common/validators/validationFailures/validation-failures.js +2 -2
- package/build/legacy/common/validators/validationFailures/validation-failures.spec.js +11 -11
- package/build/legacy/dynamicFlow/BackButton.js +2 -2
- package/build/legacy/dynamicFlow/DynamicFlow.js +5 -5
- package/build/legacy/dynamicFlow/stories/dev-tools/DynamicFlow.story.js +7 -7
- package/build/legacy/dynamicFlow/stories/dev-tools/ErrorResponses.story.js +18 -18
- package/build/legacy/dynamicFlow/stories/dev-tools/Examples.story.js +1 -1
- package/build/legacy/dynamicFlow/stories/dev-tools/Features.story.js +1 -1
- package/build/legacy/dynamicFlow/stories/dev-tools/JsonSchemaForm.story.js +5 -5
- package/build/legacy/dynamicFlow/stories/dev-tools/RefreshOnChange.story.js +24 -24
- package/build/legacy/dynamicFlow/stories/dev-tools/SearchFeature.story.js +10 -21
- package/build/legacy/dynamicFlow/stories/dev-tools/ServerTest.story.js +4 -4
- package/build/legacy/dynamicFlow/stories/dev-tools/Upload.story.js +19 -19
- package/build/legacy/dynamicFlow/stories/dev-tools/ValidationAsync.story.js +18 -18
- package/build/legacy/dynamicFlow/stories/examples/ObjectConst.story.js +25 -25
- package/build/legacy/dynamicFlow/tests/Actions.spec.js +6 -6
- package/build/legacy/dynamicFlow/tests/AllOfSchema.spec.js +17 -17
- package/build/legacy/dynamicFlow/tests/AutocompleteHints.spec.js +6 -6
- package/build/legacy/dynamicFlow/tests/DynamicFlow.BackButton.spec.js +11 -11
- package/build/legacy/dynamicFlow/tests/DynamicFlow.search.spec.js +13 -13
- package/build/legacy/dynamicFlow/tests/DynamicFlow.spec.js +48 -48
- package/build/legacy/dynamicFlow/tests/DynamicImage.spec.js +4 -4
- package/build/legacy/dynamicFlow/tests/DynamicInstructions.spec.js +3 -3
- package/build/legacy/dynamicFlow/tests/HiddenSchemas.spec.js +24 -24
- package/build/legacy/dynamicFlow/tests/ModalLayout.spec.js +20 -20
- package/build/legacy/dynamicFlow/tests/MultiSelect.spec.js +21 -21
- package/build/legacy/dynamicFlow/tests/MultipleFileUploadSchema.spec.js +24 -24
- package/build/legacy/dynamicFlow/tests/ObjectSchema.spec.js +16 -16
- package/build/legacy/dynamicFlow/tests/OneOfSchema.spec.js +77 -77
- package/build/legacy/dynamicFlow/tests/PersistAsync.blob-schema.spec.js +19 -19
- package/build/legacy/dynamicFlow/tests/PersistAsync.string-schema.spec.js +10 -10
- package/build/legacy/dynamicFlow/tests/RefreshStepOnChange.debouncing.spec.js +19 -19
- package/build/legacy/dynamicFlow/tests/RefreshStepOnChange.spec.js +46 -46
- package/build/legacy/dynamicFlow/tests/RepeatableSchema.spec.js +62 -62
- package/build/legacy/dynamicFlow/tests/StepModel.spec.js +6 -6
- package/build/legacy/dynamicFlow/tests/ValidationAsync.spec.js +13 -13
- package/build/legacy/dynamicFlow/utils/responseParsers/response-parsers.spec.js +13 -13
- package/build/legacy/dynamicFlow/utils/useDynamicFlowState.js +4 -4
- package/build/legacy/formControl/FormControl.js +9 -9
- package/build/legacy/formControl/Select.spec.js +3 -3
- package/build/legacy/formControl/utils/getAutocompleteString.js +1 -1
- package/build/legacy/formControl/utils/value-utils.js +1 -1
- package/build/legacy/jsonSchemaForm/JsonSchemaForm.end-to-end.spec.js +66 -66
- package/build/legacy/jsonSchemaForm/JsonSchemaForm.js +1 -1
- package/build/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.js +5 -5
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +1 -1
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +1 -1
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.js +6 -17
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +3 -3
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +1 -1
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.js +7 -7
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.js +6 -6
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/utils/summary-utils.js +7 -7
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/utils/summary-utils.spec.js +190 -190
- package/build/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +8 -19
- package/build/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.js +14 -14
- package/build/legacy/jsonSchemaForm/genericSchema/GenericSchema.rtl.spec.js +2 -2
- package/build/legacy/jsonSchemaForm/help/Help.js +1 -12
- package/build/legacy/jsonSchemaForm/objectSchema/ObjectSchema.js +4 -4
- package/build/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.js +12 -12
- package/build/legacy/jsonSchemaForm/oneOfSchema/utils.js +6 -6
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +1 -1
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +2 -2
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +4 -4
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +2 -2
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +2 -2
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +1 -12
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +1 -1
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +3 -3
- package/build/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +1 -1
- package/build/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +3 -3
- package/build/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +6 -6
- package/build/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.spec.js +12 -12
- package/build/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +10 -10
- package/build/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.spec.js +23 -23
- package/build/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +2 -2
- package/build/legacy/layout/DynamicLayout.js +1 -1
- package/build/legacy/layout/box/DynamicBox.js +2 -13
- package/build/legacy/layout/button/DynamicButton.js +1 -12
- package/build/legacy/layout/button/DynamicButton.spec.js +13 -24
- package/build/legacy/layout/button/utils.js +3 -3
- package/build/legacy/layout/button/utils.spec.js +6 -6
- package/build/legacy/layout/columns/DynamicColumns.js +4 -15
- package/build/legacy/layout/decision/DynamicDecision.js +1 -12
- package/build/legacy/layout/external/DynamicExternal.js +1 -1
- package/build/legacy/layout/external/DynamicExternal.messages.js +2 -2
- package/build/legacy/layout/form/DynamicForm.js +2 -2
- package/build/legacy/layout/heading/DynamicHeading.js +8 -19
- package/build/legacy/layout/image/DynamicImage.js +5 -4
- package/build/legacy/layout/instructions/DynamicInstructions.js +1 -12
- package/build/legacy/layout/list/DynamicStatusList.js +3 -3
- package/build/legacy/layout/list/DynamicStatusList.spec.js +9 -9
- package/build/legacy/layout/loadingIndicator/DynamicLoadingIndicator.js +1 -1
- package/build/legacy/layout/markdown/DynamicMarkdown.js +2 -13
- package/build/legacy/layout/markdown/DynamicMarkdown.spec.js +4 -4
- package/build/legacy/layout/modal/DynamicModal.js +2 -2
- package/build/legacy/layout/paragraph/DynamicParagraph.js +5 -16
- package/build/legacy/layout/review/DynamicReview.js +3 -14
- package/build/legacy/layout/review/DynamicReview.spec.js +6 -6
- package/build/legacy/layout/search/DynamicSearch.js +2 -13
- package/build/legacy/layout/search/SearchInput.js +1 -12
- package/build/legacy/layout/search/SearchResults.js +3 -14
- package/build/legacy/layout/search/useSearch.js +4 -4
- package/build/legacy/layout/utils/getNavigationOptionMedia.js +2 -13
- package/build/legacy/step/cameraStep/CameraStep.js +1 -1
- package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.js +6 -6
- package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.messages.js +12 -12
- package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.spec.js +13 -13
- package/build/legacy/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.js +3 -14
- package/build/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.js +1 -12
- package/build/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.js +2 -2
- package/build/legacy/step/cameraStep/cameraCapture/hooks/useFullScreenOrientationLock.js +6 -4
- package/build/legacy/step/cameraStep/cameraCapture/hooks/useVideoConstraints.js +1 -1
- package/build/legacy/step/cameraStep/cameraCapture/overlay/Overlay.js +6 -6
- package/build/legacy/step/cameraStep/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.js +1 -12
- package/build/legacy/step/cameraStep/cameraCapture/tracking/index.js +1 -1
- package/build/legacy/step/externalConfirmationStep/ExternalConfirmationStep.js +7 -7
- package/build/legacy/step/layoutStep/LayoutStep.js +1 -1
- package/build/legacy/step/layoutStep/utils/inline-reference-utils.js +3 -3
- package/build/legacy/step/layoutStep/utils/layout-utils.js +12 -12
- package/build/legacy/test-utils/DynamicFlowProviders.js +1 -12
- package/build/legacy/test-utils/legacy-utils.js +4 -4
- package/build/legacy/test-utils/log-utils.js +1 -1
- package/build/revamp/DynamicFlowCore.js +5 -5
- package/build/revamp/DynamicFlowWise.js +1 -1
- package/build/revamp/DynamicFlowWise.spec.js +11 -11
- package/build/revamp/domain/components/AllOfComponent.js +1 -1
- package/build/revamp/domain/components/BooleanInputComponent.js +2 -2
- package/build/revamp/domain/components/ConstComponent.js +1 -1
- package/build/revamp/domain/components/DateInputComponent.js +2 -2
- package/build/revamp/domain/components/IntegerInputComponent.js +2 -2
- package/build/revamp/domain/components/NumberInputComponent.js +2 -2
- package/build/revamp/domain/components/ObjectComponent.js +1 -1
- package/build/revamp/domain/components/SelectInputComponent.js +2 -2
- package/build/revamp/domain/components/StepDomainComponent.js +1 -1
- package/build/revamp/domain/components/TextInputComponent.js +2 -2
- package/build/revamp/domain/components/UploadInputComponent.js +1 -1
- package/build/revamp/domain/components/repeatableComponent/RepeatableComponent.js +1 -1
- package/build/revamp/domain/components/repeatableComponent/RepeatableComponent.spec.js +1 -1
- package/build/revamp/domain/components/searchComponent/SearchComponent.js +4 -3
- package/build/revamp/domain/components/searchComponent/SearchComponent.spec.js +13 -13
- package/build/revamp/domain/components/utils/isPartialLocalValueMatch.spec.js +7 -7
- package/build/revamp/domain/features/persistAsync/getComponentPersistAsync.js +4 -4
- package/build/revamp/domain/features/persistAsync/getComponentPersistAsync.spec.js +1 -1
- package/build/revamp/domain/features/persistAsync/getInitialPersistedState.js +1 -1
- package/build/revamp/domain/features/persistAsync/getPerformPersistAsync.spec.js +17 -17
- package/build/revamp/domain/features/search/getPerformSearchFunction.js +3 -3
- package/build/revamp/domain/features/search/getPerformSearchFunction.spec.js +18 -18
- package/build/revamp/domain/features/summary/summary-utils.js +2 -2
- package/build/revamp/domain/features/summary/summary-utils.spec.js +27 -27
- package/build/revamp/domain/features/utils/http-utils.js +1 -1
- package/build/revamp/domain/features/validation/spec-utils.js +1 -1
- package/build/revamp/domain/features/validation/validation-functions.spec.js +4 -4
- package/build/revamp/domain/features/validation/value-checks.spec.js +4 -4
- package/build/revamp/domain/features/validationAsync/getComponentValidationAsync.js +4 -3
- package/build/revamp/domain/features/validationAsync/getComponentValidationAsync.spec.js +1 -1
- package/build/revamp/domain/features/validationAsync/getInitialValidationState.js +1 -1
- package/build/revamp/domain/features/validationAsync/getPerformValidationAsync.js +1 -1
- package/build/revamp/domain/features/validationAsync/getPerformValidationAsync.spec.js +17 -17
- package/build/revamp/domain/mappers/layout/alertLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/boxLayoutToComponents.js +1 -1
- package/build/revamp/domain/mappers/layout/buttonLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/columnsLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/decisionLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/formLayoutToComponent.js +2 -2
- package/build/revamp/domain/mappers/layout/headingLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/imageLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/infoLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/instructionsLayoutToComponent.js +2 -2
- package/build/revamp/domain/mappers/layout/listLayoutToComponent.js +2 -2
- package/build/revamp/domain/mappers/layout/markdownLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/modalLayoutToComponent.js +2 -2
- package/build/revamp/domain/mappers/layout/paragraphLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/reviewLayoutToComponent.js +3 -3
- package/build/revamp/domain/mappers/layout/searchLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/layout/statusListLayoutToComponent.js +1 -1
- package/build/revamp/domain/mappers/mapSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/mapSchemaToComponent.spec.js +22 -22
- package/build/revamp/domain/mappers/mapStepToComponent.js +3 -3
- package/build/revamp/domain/mappers/mapStepToComponent.spec.js +12 -12
- package/build/revamp/domain/mappers/schema/allOfSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToRepeatableComponent.js +2 -2
- package/build/revamp/domain/mappers/schema/booleanSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/constSchemaToComponent.js +2 -2
- package/build/revamp/domain/mappers/schema/integerSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/numberSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/objectSchemaToComponent/objectSchemaToComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/objectSchemaToComponent/objectSchemaToComponent.spec.js +21 -21
- package/build/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.js +4 -4
- package/build/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.spec.js +48 -48
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToComponent.spec.js +21 -21
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToDateInputComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToTextInputComponent.js +1 -1
- package/build/revamp/domain/mappers/schema/utils/getPersistAsyncInitialState.js +1 -1
- package/build/revamp/domain/mappers/schema/utils/getValidationAsyncInitialState.js +1 -1
- package/build/revamp/domain/mappers/utils/getAutocompleteString.js +1 -1
- package/build/revamp/domain/mappers/utils/legacy-utils.js +2 -2
- package/build/revamp/flow/executeRefresh.js +2 -2
- package/build/revamp/flow/executeSubmission.js +1 -1
- package/build/revamp/renderers/CoreContainerRenderer.js +1 -1
- package/build/revamp/renderers/getRenderFunction.js +3 -3
- package/build/revamp/renderers/getSchemaErrorMessageFunction.js +12 -12
- package/build/revamp/renderers/mappers/allOfComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/buttonComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/containerComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/headingComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/hiddenComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/imageComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/instructionsComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/loadingIndicatorComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/markdownComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/modalComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/multiUploadInputComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/objectComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/paragraphComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/repeatableComponentToProps.js +2 -2
- package/build/revamp/renderers/mappers/reviewComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/searchComponentToProps.js +2 -2
- package/build/revamp/renderers/mappers/statusListComponentToProps.js +1 -1
- package/build/revamp/renderers/mappers/utils/inputComponentToProps.js +1 -1
- package/build/revamp/renderers/step/ExternalConfirmationDialog.js +2 -13
- package/build/revamp/renderers/step/StepRenderer.js +2 -13
- package/build/revamp/renderers/stepComponentToProps.js +1 -1
- package/build/revamp/stories/dev-tools/DynamicFlowRevamp.story.js +53 -53
- package/build/revamp/stories/dev-tools/EditableStep.story.js +7 -7
- package/build/revamp/stories/dev-tools/ErrorHandling.story.js +17 -17
- package/build/revamp/stories/dev-tools/External.story.js +6 -6
- package/build/revamp/stories/dev-tools/OneOf.Inititalisation.story.js +14 -14
- package/build/revamp/stories/dev-tools/PersistAsync.story.js +16 -16
- package/build/revamp/stories/dev-tools/RefreshOnChange.story.js +41 -41
- package/build/revamp/stories/dev-tools/RefreshOnChange.with.PersistAsync.story.js +210 -210
- package/build/revamp/stories/dev-tools/ServerTest.story.js +4 -4
- package/build/revamp/stories/dev-tools/Upload.story.js +18 -18
- package/build/revamp/stories/dev-tools/ValidationAsync.story.js +18 -18
- package/build/revamp/stories/examples/ObjectConst.story.js +25 -25
- package/build/revamp/stories/examples/OneOfInitialisation.story.js +10 -10
- package/build/revamp/stories/utils/fixtureHttpClient.js +1 -1
- package/build/revamp/stories/utils/mockSearchHandler.js +8 -8
- package/build/revamp/stories/visual-tests/VisualTests.story.js +1 -1
- package/build/revamp/test-utils/step-utils.js +1 -1
- package/build/revamp/tests/ImageRenderer.spec.js +3 -3
- package/build/revamp/tests/InitialAction.spec.js +9 -9
- package/build/revamp/tests/InitialStep.spec.js +3 -3
- package/build/revamp/tests/Logging.spec.js +5 -5
- package/build/revamp/tests/OneOfInitialisation.spec.js +73 -73
- package/build/revamp/tests/RefreshOnChange.ResponseHandling.spec.js +19 -19
- package/build/revamp/tests/RefreshOnChange.with.Tabs.spec.js +57 -57
- package/build/revamp/tests/RefreshOnChangePreserve.spec.js +13 -13
- package/build/revamp/tests/Submission.ResponseHandling.spec.js +38 -38
- package/build/revamp/tests/Submission.spec.js +23 -23
- package/build/revamp/tests/legacy/HiddenSchemas.spec.js +24 -24
- package/build/revamp/tests/legacy/MultipleFileUploadSchema.spec.js +27 -27
- package/build/revamp/tests/legacy/PersistAsync.blob-schema.spec.js +18 -18
- package/build/revamp/tests/legacy/PersistAsync.string-schema.spec.js +8 -8
- package/build/revamp/tests/legacy/RefreshStepOnChange.debouncing.spec.js +15 -14
- package/build/revamp/tests/legacy/RefreshStepOnChange.spec.js +50 -50
- package/build/revamp/tests/legacy/ValidationAsync.spec.js +14 -14
- package/build/revamp/tests/legacy/useExternal.spec.js +6 -6
- package/build/revamp/utils/component-utils.spec.js +43 -43
- package/build/revamp/utils/findComponent.spec.js +14 -14
- package/build/revamp/utils/type-utils.js +1 -1
- package/build/revamp/wise/renderers/AlertRenderer.js +1 -1
- package/build/revamp/wise/renderers/BooleanInputRenderer.js +2 -2
- package/build/revamp/wise/renderers/BoxRenderer.js +4 -15
- package/build/revamp/wise/renderers/ButtonRenderer.js +2 -13
- package/build/revamp/wise/renderers/ColumnsRenderer.js +4 -15
- package/build/revamp/wise/renderers/DateInputRenderer.js +2 -2
- package/build/revamp/wise/renderers/DecisionRenderer.js +3 -14
- package/build/revamp/wise/renderers/DividerRenderer.js +1 -1
- package/build/revamp/wise/renderers/FormRenderer.js +2 -13
- package/build/revamp/wise/renderers/FormSectionRenderer.js +1 -1
- package/build/revamp/wise/renderers/HeadingRenderer.js +7 -7
- package/build/revamp/wise/renderers/ImageRenderer.js +5 -4
- package/build/revamp/wise/renderers/InstructionsRenderer.js +2 -13
- package/build/revamp/wise/renderers/IntegerInputRenderer.js +3 -3
- package/build/revamp/wise/renderers/LoadingIndicatorRenderer.js +1 -1
- package/build/revamp/wise/renderers/MarkdownRenderer.js +2 -13
- package/build/revamp/wise/renderers/ModalRenderer.js +2 -2
- package/build/revamp/wise/renderers/MultiUploadInputRenderer.js +3 -14
- package/build/revamp/wise/renderers/NumberInputRenderer.js +3 -3
- package/build/revamp/wise/renderers/ParagraphRenderer.js +5 -4
- package/build/revamp/wise/renderers/RepeatableRenderer.js +5 -5
- package/build/revamp/wise/renderers/ReviewRenderer.js +5 -16
- package/build/revamp/wise/renderers/SearchRenderer.js +5 -5
- package/build/revamp/wise/renderers/SelectInputRenderer/OptionMedia.js +2 -13
- package/build/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.js +3 -14
- package/build/revamp/wise/renderers/SelectInputRenderer/SelectInputRenderer.js +1 -1
- package/build/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.js +4 -4
- package/build/revamp/wise/renderers/SelectInputRenderer/SelectTriggerMedia.js +2 -13
- package/build/revamp/wise/renderers/SelectInputRenderer/TabInputRendererComponent.js +3 -14
- package/build/revamp/wise/renderers/StatusListRenderer.js +3 -14
- package/build/revamp/wise/renderers/TextInputRenderer.js +2 -2
- package/build/revamp/wise/renderers/UploadInputRenderer.js +6 -6
- package/build/revamp/wise/renderers/components/FieldInput.js +1 -12
- package/build/revamp/wise/renderers/components/Help.js +1 -12
- package/build/revamp/wise/renderers/components/UploadFieldInput.js +3 -14
- package/build/revamp/wise/renderers/components/icon/NavigationOptionMedia.js +2 -13
- package/build/test-utils/NeptuneProviders.js +1 -1
- package/build/types/common/messages/multi-file-upload.messages.d.ts +9 -9
- package/build/types/legacy/common/utils/mobile-utils.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.d.ts +6 -6
- package/build/types/legacy/layout/external/DynamicExternal.messages.d.ts +3 -3
- package/build/types/revamp/domain/components/MultiUploadInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/UploadInputComponent.d.ts +1 -1
- package/package.json +3 -3
|
@@ -53,7 +53,7 @@ import { renderWithProviders } from '../../test-utils';
|
|
|
53
53
|
import DynamicFlow from '../DynamicFlow';
|
|
54
54
|
var user = userEvent.setup();
|
|
55
55
|
jest.mock('../../common/utils/id-utils', function () { return ({
|
|
56
|
-
generateRandomId: function () { return 'DUMMY_GENERATED_UNIQUE_ID'; }
|
|
56
|
+
generateRandomId: function () { return 'DUMMY_GENERATED_UNIQUE_ID'; },
|
|
57
57
|
}); });
|
|
58
58
|
describe('Given a oneOfSchema component!', function () {
|
|
59
59
|
var threeOptionsSchema = function (overrides) {
|
|
@@ -63,28 +63,28 @@ describe('Given a oneOfSchema component!', function () {
|
|
|
63
63
|
type: 'object',
|
|
64
64
|
title: 'Option A',
|
|
65
65
|
properties: {
|
|
66
|
-
a: { type: 'number' }
|
|
66
|
+
a: { type: 'number' },
|
|
67
67
|
},
|
|
68
68
|
required: ['a'],
|
|
69
|
-
displayOrder: ['a']
|
|
69
|
+
displayOrder: ['a'],
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
type: 'object',
|
|
73
73
|
title: 'Option B',
|
|
74
74
|
properties: {
|
|
75
|
-
b: { type: 'number' }
|
|
75
|
+
b: { type: 'number' },
|
|
76
76
|
},
|
|
77
77
|
required: ['b'],
|
|
78
|
-
displayOrder: ['b']
|
|
78
|
+
displayOrder: ['b'],
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
type: 'object',
|
|
82
82
|
title: 'Option C',
|
|
83
83
|
properties: {
|
|
84
|
-
c: { type: 'number' }
|
|
84
|
+
c: { type: 'number' },
|
|
85
85
|
},
|
|
86
86
|
required: ['c'],
|
|
87
|
-
displayOrder: ['c']
|
|
87
|
+
displayOrder: ['c'],
|
|
88
88
|
},
|
|
89
89
|
] }, overrides));
|
|
90
90
|
};
|
|
@@ -97,16 +97,16 @@ describe('Given a oneOfSchema component!', function () {
|
|
|
97
97
|
properties: {
|
|
98
98
|
firstName: {
|
|
99
99
|
title: 'First name',
|
|
100
|
-
type: 'string'
|
|
100
|
+
type: 'string',
|
|
101
101
|
},
|
|
102
102
|
lastName: {
|
|
103
103
|
$id: 'last-name-id',
|
|
104
104
|
title: 'Last name',
|
|
105
|
-
type: 'string'
|
|
106
|
-
}
|
|
105
|
+
type: 'string',
|
|
106
|
+
},
|
|
107
107
|
},
|
|
108
108
|
required: ['firstName'],
|
|
109
|
-
displayOrder: ['firstName', 'lastName']
|
|
109
|
+
displayOrder: ['firstName', 'lastName'],
|
|
110
110
|
},
|
|
111
111
|
] }, overrides));
|
|
112
112
|
};
|
|
@@ -117,11 +117,11 @@ describe('Given a oneOfSchema component!', function () {
|
|
|
117
117
|
type: 'object',
|
|
118
118
|
title: 'Option Zero (0)',
|
|
119
119
|
properties: {
|
|
120
|
-
a: { type: 'string',
|
|
121
|
-
b: { type: 'string' }
|
|
120
|
+
a: { type: 'string', const: 'AAAA' },
|
|
121
|
+
b: { type: 'string' },
|
|
122
122
|
},
|
|
123
123
|
required: ['a', 'b'],
|
|
124
|
-
displayOrder: ['a', 'b']
|
|
124
|
+
displayOrder: ['a', 'b'],
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
type: 'object',
|
|
@@ -129,46 +129,46 @@ describe('Given a oneOfSchema component!', function () {
|
|
|
129
129
|
properties: {
|
|
130
130
|
b: { type: 'string' },
|
|
131
131
|
c: { type: 'string' },
|
|
132
|
-
z: { type: 'string' }
|
|
132
|
+
z: { type: 'string' },
|
|
133
133
|
},
|
|
134
134
|
required: ['b', 'c', 'z'],
|
|
135
|
-
displayOrder: ['b', 'c', 'z']
|
|
135
|
+
displayOrder: ['b', 'c', 'z'],
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
138
|
type: 'object',
|
|
139
139
|
title: 'Option Two (2)',
|
|
140
140
|
properties: {
|
|
141
|
-
a: { type: 'string',
|
|
142
|
-
c: { type: 'string' }
|
|
141
|
+
a: { type: 'string', const: 'BBBB' },
|
|
142
|
+
c: { type: 'string' },
|
|
143
143
|
},
|
|
144
144
|
required: ['a', 'c'],
|
|
145
|
-
displayOrder: ['a', 'c']
|
|
145
|
+
displayOrder: ['a', 'c'],
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
148
|
type: 'object',
|
|
149
149
|
title: 'Option Three (3)',
|
|
150
150
|
properties: {
|
|
151
|
-
d: { type: 'string',
|
|
152
|
-
e: { type: 'string' }
|
|
151
|
+
d: { type: 'string', const: 'DDDD' },
|
|
152
|
+
e: { type: 'string' },
|
|
153
153
|
},
|
|
154
154
|
required: ['d', 'e'],
|
|
155
|
-
displayOrder: ['d', 'e']
|
|
155
|
+
displayOrder: ['d', 'e'],
|
|
156
156
|
},
|
|
157
157
|
] }, overrides));
|
|
158
158
|
};
|
|
159
159
|
var currencySchema = function (overrides) {
|
|
160
160
|
if (overrides === void 0) { overrides = {}; }
|
|
161
161
|
return (__assign({ $id: '#schema', title: 'Currency', type: 'string', oneOf: [
|
|
162
|
-
{ title: 'EUR', description: 'Euro',
|
|
162
|
+
{ title: 'EUR', description: 'Euro', const: 'EUR' },
|
|
163
163
|
{
|
|
164
164
|
title: 'GBP',
|
|
165
165
|
description: 'British pound',
|
|
166
|
-
|
|
166
|
+
const: 'GBP',
|
|
167
167
|
},
|
|
168
168
|
{
|
|
169
169
|
title: 'USD',
|
|
170
170
|
description: 'United States dollar',
|
|
171
|
-
|
|
171
|
+
const: 'USD',
|
|
172
172
|
},
|
|
173
173
|
], validationMessages: { required: 'Please enter currency.' } }, overrides));
|
|
174
174
|
};
|
|
@@ -181,15 +181,15 @@ describe('Given a oneOfSchema component!', function () {
|
|
|
181
181
|
properties: {
|
|
182
182
|
firstName: {
|
|
183
183
|
title: 'First name',
|
|
184
|
-
type: 'string'
|
|
184
|
+
type: 'string',
|
|
185
185
|
},
|
|
186
186
|
lastName: {
|
|
187
187
|
title: 'Last name',
|
|
188
|
-
type: 'string'
|
|
189
|
-
}
|
|
188
|
+
type: 'string',
|
|
189
|
+
},
|
|
190
190
|
},
|
|
191
191
|
required: ['firstName'],
|
|
192
|
-
displayOrder: ['firstName', 'lastName']
|
|
192
|
+
displayOrder: ['firstName', 'lastName'],
|
|
193
193
|
},
|
|
194
194
|
{
|
|
195
195
|
type: 'object',
|
|
@@ -197,15 +197,15 @@ describe('Given a oneOfSchema component!', function () {
|
|
|
197
197
|
properties: {
|
|
198
198
|
address: {
|
|
199
199
|
type: 'string',
|
|
200
|
-
title: 'Address'
|
|
200
|
+
title: 'Address',
|
|
201
201
|
},
|
|
202
202
|
city: {
|
|
203
203
|
type: 'string',
|
|
204
|
-
title: 'City'
|
|
205
|
-
}
|
|
204
|
+
title: 'City',
|
|
205
|
+
},
|
|
206
206
|
},
|
|
207
207
|
required: [],
|
|
208
|
-
displayOrder: ['address', 'city']
|
|
208
|
+
displayOrder: ['address', 'city'],
|
|
209
209
|
},
|
|
210
210
|
] }, overrides));
|
|
211
211
|
};
|
|
@@ -217,12 +217,12 @@ describe('Given a oneOfSchema component!', function () {
|
|
|
217
217
|
{
|
|
218
218
|
type: 'button',
|
|
219
219
|
title: 'Submit',
|
|
220
|
-
action: { url: '/submit', method: 'POST' }
|
|
220
|
+
action: { url: '/submit', method: 'POST' },
|
|
221
221
|
},
|
|
222
222
|
],
|
|
223
223
|
schemas: [schema],
|
|
224
224
|
model: model || {},
|
|
225
|
-
errors: errors || { validation: { a: 'error' } }
|
|
225
|
+
errors: errors || { validation: { a: 'error' } },
|
|
226
226
|
}); };
|
|
227
227
|
var mockHttpClient = jest.fn();
|
|
228
228
|
beforeEach(function () { return mockHttpClient.mockClear(); });
|
|
@@ -236,7 +236,7 @@ describe('Given a oneOfSchema component!', function () {
|
|
|
236
236
|
onCompletion: jest.fn(),
|
|
237
237
|
onError: jest.fn(),
|
|
238
238
|
onEvent: jest.fn(),
|
|
239
|
-
onLog: jest.fn()
|
|
239
|
+
onLog: jest.fn(),
|
|
240
240
|
});
|
|
241
241
|
};
|
|
242
242
|
describe('id prop', function () {
|
|
@@ -286,14 +286,14 @@ describe('Given a oneOfSchema component!', function () {
|
|
|
286
286
|
displayOrder: ['name', 'type'],
|
|
287
287
|
properties: {
|
|
288
288
|
name: { title: "Name for ".concat(type), type: 'string' },
|
|
289
|
-
type: {
|
|
290
|
-
}
|
|
289
|
+
type: { const: type },
|
|
290
|
+
},
|
|
291
291
|
}); };
|
|
292
292
|
var props = getProps({
|
|
293
293
|
$id: '#schema',
|
|
294
294
|
title: 'Options are AAAA, BBBB, CCCC, DDDD',
|
|
295
295
|
oneOf: ['AAAA', 'BBBB', 'CCCC'].map(objectSchema),
|
|
296
|
-
control: 'tab'
|
|
296
|
+
control: 'tab',
|
|
297
297
|
}, { name: 'Bob', type: 'CCCC' });
|
|
298
298
|
it('should select the schema that is best matched by the model', function () {
|
|
299
299
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, props)));
|
|
@@ -341,7 +341,7 @@ describe('Given a oneOfSchema component!', function () {
|
|
|
341
341
|
expect(screen.queryByText('Option C')).not.toBeInTheDocument();
|
|
342
342
|
});
|
|
343
343
|
describe('and there is a valid default value', function () {
|
|
344
|
-
var props = getProps(threeOptionsSchema({
|
|
344
|
+
var props = getProps(threeOptionsSchema({ default: { b: 123 } }), {});
|
|
345
345
|
it('selects the schema with the valid default value', function () {
|
|
346
346
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, props)));
|
|
347
347
|
expect(screen.queryByText('Option A')).not.toBeInTheDocument();
|
|
@@ -352,7 +352,7 @@ describe('Given a oneOfSchema component!', function () {
|
|
|
352
352
|
});
|
|
353
353
|
describe('and children schemas are const', function () {
|
|
354
354
|
describe('and there is a valid default value', function () {
|
|
355
|
-
var props = getProps(currencySchema({
|
|
355
|
+
var props = getProps(currencySchema({ default: 'USD' }), {});
|
|
356
356
|
it('selects the schema with the valid default value', function () {
|
|
357
357
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, props)));
|
|
358
358
|
expect(screen.getByText('USD')).toBeInTheDocument();
|
|
@@ -380,14 +380,14 @@ describe('Given a oneOfSchema component!', function () {
|
|
|
380
380
|
currency: {
|
|
381
381
|
title: 'Currency',
|
|
382
382
|
oneOf: [
|
|
383
|
-
{ title: 'EUR',
|
|
384
|
-
{ title: 'GBP',
|
|
385
|
-
{ title: 'USD',
|
|
383
|
+
{ title: 'EUR', const: 'EUR', hidden: true },
|
|
384
|
+
{ title: 'GBP', const: 'GBP', hidden: true },
|
|
385
|
+
{ title: 'USD', const: 'USD', hidden: true },
|
|
386
386
|
],
|
|
387
387
|
control: 'select',
|
|
388
|
-
|
|
389
|
-
}
|
|
390
|
-
}
|
|
388
|
+
default: 'USD',
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
391
|
}, {});
|
|
392
392
|
it('selects the default', function () {
|
|
393
393
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, props)));
|
|
@@ -405,13 +405,13 @@ describe('Given a oneOfSchema component!', function () {
|
|
|
405
405
|
currency: {
|
|
406
406
|
title: 'Currency',
|
|
407
407
|
oneOf: [
|
|
408
|
-
{ title: 'EUR',
|
|
409
|
-
{ title: 'GBP',
|
|
408
|
+
{ title: 'EUR', const: 'EUR', hidden: true },
|
|
409
|
+
{ title: 'GBP', const: 'GBP', hidden: true },
|
|
410
410
|
],
|
|
411
411
|
control: 'radio',
|
|
412
|
-
|
|
413
|
-
}
|
|
414
|
-
}
|
|
412
|
+
default: 'GBP',
|
|
413
|
+
},
|
|
414
|
+
},
|
|
415
415
|
}, {});
|
|
416
416
|
it('selects the default', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
417
417
|
return __generator(this, function (_a) {
|
|
@@ -440,13 +440,13 @@ describe('Given a oneOfSchema component!', function () {
|
|
|
440
440
|
currency: {
|
|
441
441
|
title: 'Currency',
|
|
442
442
|
oneOf: [
|
|
443
|
-
{ title: 'EUR',
|
|
444
|
-
{ title: 'GBP',
|
|
445
|
-
{ title: 'USD',
|
|
443
|
+
{ title: 'EUR', const: 'EUR', hidden: true },
|
|
444
|
+
{ title: 'GBP', const: 'GBP', hidden: true },
|
|
445
|
+
{ title: 'USD', const: 'USD', hidden: true },
|
|
446
446
|
],
|
|
447
|
-
control: 'select'
|
|
448
|
-
}
|
|
449
|
-
}
|
|
447
|
+
control: 'select',
|
|
448
|
+
},
|
|
449
|
+
},
|
|
450
450
|
}, {});
|
|
451
451
|
it('does not select an option', function () {
|
|
452
452
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, props)));
|
|
@@ -464,12 +464,12 @@ describe('Given a oneOfSchema component!', function () {
|
|
|
464
464
|
currency: {
|
|
465
465
|
title: 'Currency',
|
|
466
466
|
oneOf: [
|
|
467
|
-
{ title: 'EUR',
|
|
468
|
-
{ title: 'GBP',
|
|
467
|
+
{ title: 'EUR', const: 'EUR', hidden: true },
|
|
468
|
+
{ title: 'GBP', const: 'GBP', hidden: true },
|
|
469
469
|
],
|
|
470
|
-
control: 'radio'
|
|
471
|
-
}
|
|
472
|
-
}
|
|
470
|
+
control: 'radio',
|
|
471
|
+
},
|
|
472
|
+
},
|
|
473
473
|
}, {});
|
|
474
474
|
it('does not select any of the radio buttons', function () {
|
|
475
475
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, props)));
|
|
@@ -559,15 +559,15 @@ describe('Given a oneOfSchema component!', function () {
|
|
|
559
559
|
properties: {
|
|
560
560
|
firstName: {
|
|
561
561
|
title: 'First name',
|
|
562
|
-
type: 'string'
|
|
562
|
+
type: 'string',
|
|
563
563
|
},
|
|
564
564
|
lastName: {
|
|
565
565
|
title: 'Last name',
|
|
566
|
-
type: 'string'
|
|
567
|
-
}
|
|
566
|
+
type: 'string',
|
|
567
|
+
},
|
|
568
568
|
},
|
|
569
569
|
required: ['firstName'],
|
|
570
|
-
displayOrder: ['firstName', 'lastName']
|
|
570
|
+
displayOrder: ['firstName', 'lastName'],
|
|
571
571
|
},
|
|
572
572
|
{
|
|
573
573
|
type: 'object',
|
|
@@ -575,17 +575,17 @@ describe('Given a oneOfSchema component!', function () {
|
|
|
575
575
|
properties: {
|
|
576
576
|
address: {
|
|
577
577
|
type: 'string',
|
|
578
|
-
title: 'Address'
|
|
578
|
+
title: 'Address',
|
|
579
579
|
},
|
|
580
580
|
city: {
|
|
581
581
|
type: 'string',
|
|
582
|
-
title: 'City'
|
|
583
|
-
}
|
|
582
|
+
title: 'City',
|
|
583
|
+
},
|
|
584
584
|
},
|
|
585
585
|
required: ['address'],
|
|
586
|
-
displayOrder: ['address', 'city']
|
|
586
|
+
displayOrder: ['address', 'city'],
|
|
587
587
|
},
|
|
588
|
-
]
|
|
588
|
+
],
|
|
589
589
|
};
|
|
590
590
|
props = getProps(schema, { firstName: 'Colin', city: 'New York' });
|
|
591
591
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, props)));
|
|
@@ -616,7 +616,7 @@ describe('Given a oneOfSchema component!', function () {
|
|
|
616
616
|
});
|
|
617
617
|
});
|
|
618
618
|
describe('when the choice is from a set of constant values', function () {
|
|
619
|
-
var props = getProps(currencySchema({ required: ['Currency'],
|
|
619
|
+
var props = getProps(currencySchema({ required: ['Currency'], default: 'EUR' }), {});
|
|
620
620
|
it('should render the schema title in a label', function () {
|
|
621
621
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, props)));
|
|
622
622
|
expect(screen.getByLabelText('Currency')).toBeInTheDocument();
|
|
@@ -625,7 +625,7 @@ describe('Given a oneOfSchema component!', function () {
|
|
|
625
625
|
var schema = {
|
|
626
626
|
$id: '#schema',
|
|
627
627
|
title: 'Choose schema',
|
|
628
|
-
oneOf: [{ title: 'One',
|
|
628
|
+
oneOf: [{ title: 'One', const: 1 }],
|
|
629
629
|
};
|
|
630
630
|
var props = getProps(schema);
|
|
631
631
|
it('should render a select trigger', function () {
|
|
@@ -753,15 +753,15 @@ describe('Given a oneOfSchema component!', function () {
|
|
|
753
753
|
{
|
|
754
754
|
title: 'A - Title',
|
|
755
755
|
description: 'A - Normal length description',
|
|
756
|
-
|
|
756
|
+
const: 'A',
|
|
757
757
|
},
|
|
758
758
|
{
|
|
759
759
|
title: 'B - Long title long title long title',
|
|
760
760
|
description: 'B - Normal length description',
|
|
761
|
-
|
|
761
|
+
const: 'B',
|
|
762
762
|
},
|
|
763
763
|
],
|
|
764
|
-
control: 'radio'
|
|
764
|
+
control: 'radio',
|
|
765
765
|
});
|
|
766
766
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, props)));
|
|
767
767
|
expect(screen.getByText('A - Title')).toBeInTheDocument();
|
|
@@ -72,11 +72,11 @@ describe('PersistAsync with blob schema', function () {
|
|
|
72
72
|
$id: '#persist-async-schema',
|
|
73
73
|
type: 'blob',
|
|
74
74
|
maxSize: 150000,
|
|
75
|
-
accepts: ['image/png', 'image/jpg']
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
75
|
+
accepts: ['image/png', 'image/jpg'],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
80
|
};
|
|
81
81
|
var model = {};
|
|
82
82
|
var initialStep = {
|
|
@@ -87,11 +87,11 @@ describe('PersistAsync with blob schema', function () {
|
|
|
87
87
|
{
|
|
88
88
|
type: 'button',
|
|
89
89
|
title: 'Submit',
|
|
90
|
-
action: { url: '/submit', method: 'POST' }
|
|
90
|
+
action: { url: '/submit', method: 'POST' },
|
|
91
91
|
},
|
|
92
92
|
],
|
|
93
93
|
schemas: [schema],
|
|
94
|
-
model: model
|
|
94
|
+
model: model,
|
|
95
95
|
};
|
|
96
96
|
var getProps = function (overrides) {
|
|
97
97
|
if (overrides === void 0) { overrides = {}; }
|
|
@@ -132,11 +132,11 @@ describe('PersistAsync with blob schema', function () {
|
|
|
132
132
|
$id: '#persist-async-schema',
|
|
133
133
|
type: 'blob',
|
|
134
134
|
maxSize: 150000,
|
|
135
|
-
accepts: ['image/png', 'image/jpg']
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
135
|
+
accepts: ['image/png', 'image/jpg'],
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
140
|
};
|
|
141
141
|
var props = getProps({ initialStep: __assign(__assign({}, initialStep), { schemas: [schemaWithNoId] }) });
|
|
142
142
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, props)));
|
|
@@ -163,11 +163,11 @@ describe('PersistAsync with blob schema', function () {
|
|
|
163
163
|
schema: {
|
|
164
164
|
type: 'blob',
|
|
165
165
|
maxSize: 150000,
|
|
166
|
-
accepts: ['image/png', 'image/jpg']
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
166
|
+
accepts: ['image/png', 'image/jpg'],
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
171
|
};
|
|
172
172
|
var props = getProps({ initialStep: __assign(__assign({}, initialStep), { schemas: [schemaWithNoId] }) });
|
|
173
173
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, props)));
|
|
@@ -195,7 +195,7 @@ describe('PersistAsync with blob schema', function () {
|
|
|
195
195
|
_a.sent();
|
|
196
196
|
expect(httpClient).toHaveBeenCalledWith('/upload-file-url', {
|
|
197
197
|
method: 'POST',
|
|
198
|
-
body: expect.any(FormData)
|
|
198
|
+
body: expect.any(FormData),
|
|
199
199
|
});
|
|
200
200
|
formData = httpClient.mock.calls[0][1].body;
|
|
201
201
|
expect(formData.get('file')).toBe(file);
|
|
@@ -308,7 +308,7 @@ describe('PersistAsync with blob schema', function () {
|
|
|
308
308
|
case 0:
|
|
309
309
|
httpClient = jest.fn(function () {
|
|
310
310
|
return Promise.resolve(new Response(JSON.stringify({
|
|
311
|
-
validation: { file: 'The server overlords dislike the uploaded file.' }
|
|
311
|
+
validation: { file: 'The server overlords dislike the uploaded file.' },
|
|
312
312
|
}), { status: 422 }));
|
|
313
313
|
});
|
|
314
314
|
props = getProps({ httpClient: httpClient });
|
|
@@ -61,7 +61,7 @@ describe('PersistAsync with string schema (basic)', function () {
|
|
|
61
61
|
properties: {
|
|
62
62
|
name: {
|
|
63
63
|
title: 'Name on Card',
|
|
64
|
-
type: 'string'
|
|
64
|
+
type: 'string',
|
|
65
65
|
},
|
|
66
66
|
cardNumber: {
|
|
67
67
|
type: 'string',
|
|
@@ -74,11 +74,11 @@ describe('PersistAsync with string schema (basic)', function () {
|
|
|
74
74
|
title: 'Card Number',
|
|
75
75
|
type: 'string',
|
|
76
76
|
minLength: 15,
|
|
77
|
-
maxLength: 16
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
77
|
+
maxLength: 16,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
82
|
};
|
|
83
83
|
var model = {};
|
|
84
84
|
var initialStep = {
|
|
@@ -89,11 +89,11 @@ describe('PersistAsync with string schema (basic)', function () {
|
|
|
89
89
|
{
|
|
90
90
|
type: 'button',
|
|
91
91
|
title: 'Submit',
|
|
92
|
-
action: { url: '/submit', method: 'POST' }
|
|
92
|
+
action: { url: '/submit', method: 'POST' },
|
|
93
93
|
},
|
|
94
94
|
],
|
|
95
95
|
schemas: [schema],
|
|
96
|
-
model: model
|
|
96
|
+
model: model,
|
|
97
97
|
};
|
|
98
98
|
var getProps = function (overrides) {
|
|
99
99
|
if (overrides === void 0) { overrides = {}; }
|
|
@@ -221,7 +221,7 @@ describe('PersistAsync with string schema (basic)', function () {
|
|
|
221
221
|
_a.sent();
|
|
222
222
|
return [4 /*yield*/, waitFor(function () {
|
|
223
223
|
expect(httpClient).toHaveBeenCalledWith('/submit', expect.objectContaining({
|
|
224
|
-
body: '{"cardNumber":"SECOND-TOKEN"}'
|
|
224
|
+
body: '{"cardNumber":"SECOND-TOKEN"}',
|
|
225
225
|
}));
|
|
226
226
|
})];
|
|
227
227
|
case 9:
|
|
@@ -321,7 +321,7 @@ describe('PersistAsync with string schema (basic)', function () {
|
|
|
321
321
|
_a.sent();
|
|
322
322
|
return [4 /*yield*/, waitFor(function () {
|
|
323
323
|
expect(httpClient).toHaveBeenCalledWith('/submit', expect.objectContaining({
|
|
324
|
-
body: '{"cardNumber":"9sowP4YdJy6LdgoVEvkGvcrcahYguaMn"}'
|
|
324
|
+
body: '{"cardNumber":"9sowP4YdJy6LdgoVEvkGvcrcahYguaMn"}',
|
|
325
325
|
}));
|
|
326
326
|
})];
|
|
327
327
|
case 6:
|
|
@@ -64,14 +64,14 @@ describe('useDebouncedRefresh', function () {
|
|
|
64
64
|
name: {
|
|
65
65
|
title: 'Name',
|
|
66
66
|
type: 'string',
|
|
67
|
-
refreshStepOnChange: true
|
|
67
|
+
refreshStepOnChange: true,
|
|
68
68
|
},
|
|
69
69
|
terms: {
|
|
70
70
|
title: 'I accept the terms and conditions',
|
|
71
71
|
type: 'boolean',
|
|
72
|
-
refreshStepOnChange: true
|
|
73
|
-
}
|
|
74
|
-
}
|
|
72
|
+
refreshStepOnChange: true,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
75
|
};
|
|
76
76
|
var debounceableDeprecatedSchema = {
|
|
77
77
|
$id: '#debounced-deprecated-schema',
|
|
@@ -84,21 +84,21 @@ describe('useDebouncedRefresh', function () {
|
|
|
84
84
|
title: 'Name',
|
|
85
85
|
type: 'string',
|
|
86
86
|
refreshStepOnChange: true,
|
|
87
|
-
refreshFormUrl: '/refresh1'
|
|
87
|
+
refreshFormUrl: '/refresh1',
|
|
88
88
|
},
|
|
89
89
|
address: {
|
|
90
90
|
title: 'Address',
|
|
91
91
|
type: 'string',
|
|
92
92
|
refreshStepOnChange: true,
|
|
93
|
-
refreshFormUrl: '/refresh2'
|
|
93
|
+
refreshFormUrl: '/refresh2',
|
|
94
94
|
},
|
|
95
95
|
terms: {
|
|
96
96
|
title: 'I accept the terms and conditions',
|
|
97
97
|
type: 'boolean',
|
|
98
98
|
refreshStepOnChange: true,
|
|
99
|
-
refreshFormUrl: '/refresh3'
|
|
100
|
-
}
|
|
101
|
-
}
|
|
99
|
+
refreshFormUrl: '/refresh3',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
102
|
};
|
|
103
103
|
var model = { name: '', address: '' };
|
|
104
104
|
var initialStep = {
|
|
@@ -110,7 +110,7 @@ describe('useDebouncedRefresh', function () {
|
|
|
110
110
|
{ type: 'button', title: 'Submit', action: { url: '/submit', method: 'POST' } },
|
|
111
111
|
],
|
|
112
112
|
schemas: [debounceableSchema, debounceableDeprecatedSchema],
|
|
113
|
-
model: model
|
|
113
|
+
model: model,
|
|
114
114
|
};
|
|
115
115
|
var initialDeprecatedStep = {
|
|
116
116
|
id: 'debounced-refresh-initial-step',
|
|
@@ -121,7 +121,7 @@ describe('useDebouncedRefresh', function () {
|
|
|
121
121
|
{ type: 'button', title: 'Submit', action: { url: '/submit', method: 'POST' } },
|
|
122
122
|
],
|
|
123
123
|
schemas: [debounceableDeprecatedSchema],
|
|
124
|
-
model: model
|
|
124
|
+
model: model,
|
|
125
125
|
};
|
|
126
126
|
var mockHttpClient = jest.fn();
|
|
127
127
|
var getProps = function (step, overrides) {
|
|
@@ -192,10 +192,10 @@ describe('useDebouncedRefresh', function () {
|
|
|
192
192
|
case 5:
|
|
193
193
|
_a.sent();
|
|
194
194
|
expect(props.httpClient).toHaveBeenCalledWith('/refresh1', expect.objectContaining({
|
|
195
|
-
body: '{"terms":false,"name":"Colin Robinson"}'
|
|
195
|
+
body: '{"terms":false,"name":"Colin Robinson"}',
|
|
196
196
|
}));
|
|
197
197
|
expect(props.httpClient).toHaveBeenCalledWith('/refresh2', expect.objectContaining({
|
|
198
|
-
body: '{"terms":false,"name":"Colin Robinson","address":"New York"}'
|
|
198
|
+
body: '{"terms":false,"name":"Colin Robinson","address":"New York"}',
|
|
199
199
|
}));
|
|
200
200
|
return [2 /*return*/];
|
|
201
201
|
}
|
|
@@ -242,12 +242,12 @@ describe('shouldDebounceSchema', function () {
|
|
|
242
242
|
{
|
|
243
243
|
title: 'oneOf schema',
|
|
244
244
|
schema: { oneOf: [{ type: 'string' }, { type: 'number' }] },
|
|
245
|
-
expectation: false
|
|
245
|
+
expectation: false,
|
|
246
246
|
},
|
|
247
247
|
{
|
|
248
248
|
title: 'oneOf consts schema',
|
|
249
|
-
schema: { oneOf: [{
|
|
250
|
-
expectation: false
|
|
249
|
+
schema: { oneOf: [{ const: 0 }, { const: 1 }, { const: 2 }] },
|
|
250
|
+
expectation: false,
|
|
251
251
|
},
|
|
252
252
|
{ title: 'boolean schema', schema: { type: 'boolean' }, expectation: false },
|
|
253
253
|
{ title: 'array schema', schema: { type: 'array' }, expectation: false },
|
|
@@ -256,14 +256,14 @@ describe('shouldDebounceSchema', function () {
|
|
|
256
256
|
schema: {
|
|
257
257
|
type: 'object',
|
|
258
258
|
properties: { a: { type: 'string' }, b: { type: 'integer' } },
|
|
259
|
-
displayOrder: ['a', 'b']
|
|
259
|
+
displayOrder: ['a', 'b'],
|
|
260
260
|
},
|
|
261
|
-
expectation: false
|
|
261
|
+
expectation: false,
|
|
262
262
|
},
|
|
263
263
|
{
|
|
264
264
|
title: 'string base64url schema',
|
|
265
265
|
schema: { type: 'string', format: 'base64url' },
|
|
266
|
-
expectation: false
|
|
266
|
+
expectation: false,
|
|
267
267
|
},
|
|
268
268
|
];
|
|
269
269
|
it.each(cases)('$title -> $expectation', function (_a) {
|