@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
|
@@ -71,24 +71,24 @@ var currencySelectSchema = {
|
|
|
71
71
|
title: 'EUR',
|
|
72
72
|
description: 'Euro',
|
|
73
73
|
icon: { name: 'flag-eur' },
|
|
74
|
-
|
|
74
|
+
const: 'EUR',
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
title: 'GBP',
|
|
78
78
|
description: 'British pound',
|
|
79
79
|
icon: { name: 'flag-gbp' },
|
|
80
|
-
|
|
80
|
+
const: 'GBP',
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
title: 'USD',
|
|
84
84
|
description: 'US dollar',
|
|
85
85
|
icon: { name: 'flag-usd' },
|
|
86
|
-
|
|
86
|
+
const: 'USD',
|
|
87
87
|
},
|
|
88
|
-
]
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
92
|
};
|
|
93
93
|
var basicStep = {
|
|
94
94
|
id: 'MultiSelect',
|
|
@@ -97,14 +97,14 @@ var basicStep = {
|
|
|
97
97
|
layout: [
|
|
98
98
|
{
|
|
99
99
|
type: 'form',
|
|
100
|
-
schemaId: '#schema'
|
|
100
|
+
schemaId: '#schema',
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
103
|
type: 'button',
|
|
104
104
|
title: 'Submit',
|
|
105
|
-
action: { url: '/submit', method: 'POST' }
|
|
105
|
+
action: { url: '/submit', method: 'POST' },
|
|
106
106
|
},
|
|
107
|
-
]
|
|
107
|
+
],
|
|
108
108
|
};
|
|
109
109
|
var mockHttpClient = jest.fn();
|
|
110
110
|
var getProps = function (overrides) {
|
|
@@ -123,7 +123,7 @@ describe('Multi-Select', function () {
|
|
|
123
123
|
switch (_a.label) {
|
|
124
124
|
case 0:
|
|
125
125
|
props = getProps({
|
|
126
|
-
initialStep: __assign(__assign({}, basicStep), { model: { currencies: ['USD', 'GBP'] } })
|
|
126
|
+
initialStep: __assign(__assign({}, basicStep), { model: { currencies: ['USD', 'GBP'] } }),
|
|
127
127
|
});
|
|
128
128
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, props)));
|
|
129
129
|
expect(screen.getByText(/USD and 1 more/)).toBeInTheDocument();
|
|
@@ -132,7 +132,7 @@ describe('Multi-Select', function () {
|
|
|
132
132
|
_a.sent();
|
|
133
133
|
return [4 /*yield*/, waitFor(function () {
|
|
134
134
|
expect(mockHttpClient).toHaveBeenCalledWith('/submit', expect.objectContaining({
|
|
135
|
-
body: JSON.stringify({ currencies: ['USD', 'GBP'] })
|
|
135
|
+
body: JSON.stringify({ currencies: ['USD', 'GBP'] }),
|
|
136
136
|
}));
|
|
137
137
|
})];
|
|
138
138
|
case 2:
|
|
@@ -147,7 +147,7 @@ describe('Multi-Select', function () {
|
|
|
147
147
|
switch (_a.label) {
|
|
148
148
|
case 0:
|
|
149
149
|
props = getProps({
|
|
150
|
-
initialStep: __assign(__assign({}, basicStep), { model: { currencies: ['GBP', 'USD', 'AUD'] } })
|
|
150
|
+
initialStep: __assign(__assign({}, basicStep), { model: { currencies: ['GBP', 'USD', 'AUD'] } }),
|
|
151
151
|
});
|
|
152
152
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, props)));
|
|
153
153
|
expect(screen.getByText(/GBP and 1 more/)).toBeInTheDocument();
|
|
@@ -156,7 +156,7 @@ describe('Multi-Select', function () {
|
|
|
156
156
|
_a.sent();
|
|
157
157
|
return [4 /*yield*/, waitFor(function () {
|
|
158
158
|
expect(mockHttpClient).toHaveBeenCalledWith('/submit', expect.objectContaining({
|
|
159
|
-
body: JSON.stringify({ currencies: ['GBP', 'USD'] })
|
|
159
|
+
body: JSON.stringify({ currencies: ['GBP', 'USD'] }),
|
|
160
160
|
}));
|
|
161
161
|
})];
|
|
162
162
|
case 2:
|
|
@@ -168,7 +168,7 @@ describe('Multi-Select', function () {
|
|
|
168
168
|
});
|
|
169
169
|
describe('when validation errors are provided in the step', function () {
|
|
170
170
|
var props = getProps({
|
|
171
|
-
initialStep: __assign(__assign({}, basicStep), { model: null, errors: { validation: { currencies: 'You cannot select USD and EUR' } } })
|
|
171
|
+
initialStep: __assign(__assign({}, basicStep), { model: null, errors: { validation: { currencies: 'You cannot select USD and EUR' } } }),
|
|
172
172
|
});
|
|
173
173
|
it('should display initial errors', function () {
|
|
174
174
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, props)));
|
|
@@ -198,7 +198,7 @@ describe('Multi-Select', function () {
|
|
|
198
198
|
});
|
|
199
199
|
describe('when the user selects an item', function () {
|
|
200
200
|
var props = getProps({
|
|
201
|
-
initialStep: __assign(__assign({}, basicStep), { model: { currencies: ['USD'] } })
|
|
201
|
+
initialStep: __assign(__assign({}, basicStep), { model: { currencies: ['USD'] } }),
|
|
202
202
|
});
|
|
203
203
|
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
204
204
|
return __generator(this, function (_a) {
|
|
@@ -229,7 +229,7 @@ describe('Multi-Select', function () {
|
|
|
229
229
|
_a.sent();
|
|
230
230
|
return [4 /*yield*/, waitFor(function () {
|
|
231
231
|
expect(mockHttpClient).toHaveBeenCalledWith('/submit', expect.objectContaining({
|
|
232
|
-
body: JSON.stringify({ currencies: ['USD', 'EUR'] })
|
|
232
|
+
body: JSON.stringify({ currencies: ['USD', 'EUR'] }),
|
|
233
233
|
}));
|
|
234
234
|
})];
|
|
235
235
|
case 2:
|
|
@@ -241,7 +241,7 @@ describe('Multi-Select', function () {
|
|
|
241
241
|
});
|
|
242
242
|
describe('when the user de-selects an item', function () {
|
|
243
243
|
var props = getProps({
|
|
244
|
-
initialStep: __assign(__assign({}, basicStep), { model: { currencies: ['USD', 'EUR', 'GBP'] } })
|
|
244
|
+
initialStep: __assign(__assign({}, basicStep), { model: { currencies: ['USD', 'EUR', 'GBP'] } }),
|
|
245
245
|
});
|
|
246
246
|
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
247
247
|
return __generator(this, function (_a) {
|
|
@@ -272,7 +272,7 @@ describe('Multi-Select', function () {
|
|
|
272
272
|
_a.sent();
|
|
273
273
|
return [4 /*yield*/, waitFor(function () {
|
|
274
274
|
expect(mockHttpClient).toHaveBeenCalledWith('/submit', expect.objectContaining({
|
|
275
|
-
body: JSON.stringify({ currencies: ['USD', 'GBP'] })
|
|
275
|
+
body: JSON.stringify({ currencies: ['USD', 'GBP'] }),
|
|
276
276
|
}));
|
|
277
277
|
})];
|
|
278
278
|
case 2:
|
|
@@ -285,7 +285,7 @@ describe('Multi-Select', function () {
|
|
|
285
285
|
describe('local validation', function () {
|
|
286
286
|
describe('when minItems is provided', function () {
|
|
287
287
|
var props = getProps({
|
|
288
|
-
initialStep: __assign(__assign({}, basicStep), { model: { currencies: ['USD'] } })
|
|
288
|
+
initialStep: __assign(__assign({}, basicStep), { model: { currencies: ['USD'] } }),
|
|
289
289
|
});
|
|
290
290
|
it('should block submission and show an error message when submission is attempted', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
291
291
|
return __generator(this, function (_a) {
|
|
@@ -305,7 +305,7 @@ describe('Multi-Select', function () {
|
|
|
305
305
|
});
|
|
306
306
|
describe('when maxItems is provided', function () {
|
|
307
307
|
var props = getProps({
|
|
308
|
-
initialStep: __assign(__assign({}, basicStep), { model: { currencies: ['GBP', 'USD', 'EUR'] } })
|
|
308
|
+
initialStep: __assign(__assign({}, basicStep), { model: { currencies: ['GBP', 'USD', 'EUR'] } }),
|
|
309
309
|
});
|
|
310
310
|
it('should block submission and show an error message when submission is attempted', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
311
311
|
return __generator(this, function (_a) {
|
|
@@ -53,7 +53,7 @@ import DynamicFlow from '../DynamicFlow';
|
|
|
53
53
|
var user = userEvent.setup();
|
|
54
54
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
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 multiple file upload schema', function () {
|
|
59
59
|
var accepts = ['image/png', 'image/jpg', 'application/pdf'];
|
|
@@ -77,10 +77,10 @@ describe('Given a multiple file upload schema', function () {
|
|
|
77
77
|
maxSize: maxSize,
|
|
78
78
|
accepts: accepts,
|
|
79
79
|
validationMessages: {
|
|
80
|
-
maxSize: 'Your file is too large'
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
80
|
+
maxSize: 'Your file is too large',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
84
|
} }, overrides)); };
|
|
85
85
|
var getMultipleFileUploadSchemaObject = function (arraySchema) {
|
|
86
86
|
if (arraySchema === void 0) { arraySchema = getArraySchema({}); }
|
|
@@ -91,8 +91,8 @@ describe('Given a multiple file upload schema', function () {
|
|
|
91
91
|
required: ['files'],
|
|
92
92
|
title: 'upload schema title',
|
|
93
93
|
properties: {
|
|
94
|
-
files: __assign({ $id: 'upload-id' }, arraySchema)
|
|
95
|
-
}
|
|
94
|
+
files: __assign({ $id: 'upload-id' }, arraySchema),
|
|
95
|
+
},
|
|
96
96
|
});
|
|
97
97
|
};
|
|
98
98
|
var getMultipleFileUploadSchemaObjectWithoutId = function () {
|
|
@@ -105,13 +105,13 @@ describe('Given a multiple file upload schema', function () {
|
|
|
105
105
|
properties: {
|
|
106
106
|
files: __assign(__assign({}, getArraySchema({})), { minItems: 2, maxItems: 3, validationMessages: {
|
|
107
107
|
minItems: 'minimum items not met error (from schema)',
|
|
108
|
-
maxItems: 'maximum items uploaded already (from schema)'
|
|
109
|
-
} })
|
|
108
|
+
maxItems: 'maximum items uploaded already (from schema)',
|
|
109
|
+
} }),
|
|
110
110
|
},
|
|
111
111
|
validationMessages: {
|
|
112
112
|
minItems: 'minimum items not met error (from schema)',
|
|
113
|
-
maxItems: 'maximum items uploaded already (from schema)'
|
|
114
|
-
}
|
|
113
|
+
maxItems: 'maximum items uploaded already (from schema)',
|
|
114
|
+
},
|
|
115
115
|
});
|
|
116
116
|
};
|
|
117
117
|
var testFile = new File([], 'test-file.pdf', { type: 'application/pdf' });
|
|
@@ -124,12 +124,12 @@ describe('Given a multiple file upload schema', function () {
|
|
|
124
124
|
{
|
|
125
125
|
type: 'button',
|
|
126
126
|
title: 'Submit',
|
|
127
|
-
action: { url: '/submit', method: 'POST' }
|
|
127
|
+
action: { url: '/submit', method: 'POST' },
|
|
128
128
|
},
|
|
129
129
|
],
|
|
130
130
|
schemas: [getMultipleFileUploadSchemaObject()],
|
|
131
131
|
model: {},
|
|
132
|
-
errors: {}
|
|
132
|
+
errors: {},
|
|
133
133
|
};
|
|
134
134
|
var onEvent = jest.fn();
|
|
135
135
|
var getProps = function (overrides) {
|
|
@@ -141,7 +141,7 @@ describe('Given a multiple file upload schema', function () {
|
|
|
141
141
|
mockHttpClient.mockResolvedValue({
|
|
142
142
|
ok: true,
|
|
143
143
|
status: 200,
|
|
144
|
-
json: jest.fn().mockResolvedValue((_a = {}, _a[idProperty] = 'mockFileId', _a))
|
|
144
|
+
json: jest.fn().mockResolvedValue((_a = {}, _a[idProperty] = 'mockFileId', _a)),
|
|
145
145
|
});
|
|
146
146
|
});
|
|
147
147
|
afterEach(function () {
|
|
@@ -158,7 +158,7 @@ describe('Given a multiple file upload schema', function () {
|
|
|
158
158
|
describe('and the schema has no $id prop', function () {
|
|
159
159
|
it('should be a generated id given to the input component', function () {
|
|
160
160
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, getProps({
|
|
161
|
-
initialStep: __assign(__assign({}, initialStep), { schemas: [getMultipleFileUploadSchemaObjectWithoutId()] })
|
|
161
|
+
initialStep: __assign(__assign({}, initialStep), { schemas: [getMultipleFileUploadSchemaObjectWithoutId()] }),
|
|
162
162
|
}))));
|
|
163
163
|
expect(screen.getByLabelText('upload schema title')).toBeInTheDocument();
|
|
164
164
|
expect(screen.getByLabelText('upload schema title')).toHaveAttribute('id', 'DUMMY_GENERATED_UNIQUE_ID');
|
|
@@ -225,7 +225,7 @@ describe('Given a multiple file upload schema', function () {
|
|
|
225
225
|
mockHttpClient.mockResolvedValueOnce({
|
|
226
226
|
ok: false,
|
|
227
227
|
status: 422,
|
|
228
|
-
json: jest.fn().mockResolvedValue({ validation: (_a = {}, _a[param] = errorMessage, _a) })
|
|
228
|
+
json: jest.fn().mockResolvedValue({ validation: (_a = {}, _a[param] = errorMessage, _a) }),
|
|
229
229
|
});
|
|
230
230
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, getProps())));
|
|
231
231
|
onEvent.mockClear();
|
|
@@ -258,7 +258,7 @@ describe('Given a multiple file upload schema', function () {
|
|
|
258
258
|
mockHttpClient.mockResolvedValueOnce({
|
|
259
259
|
ok: false,
|
|
260
260
|
status: 422,
|
|
261
|
-
json: jest.fn().mockResolvedValue({ validation: (_a = {}, _a[param] = errorMessage, _a) })
|
|
261
|
+
json: jest.fn().mockResolvedValue({ validation: (_a = {}, _a[param] = errorMessage, _a) }),
|
|
262
262
|
});
|
|
263
263
|
return [4 /*yield*/, user.upload(screen.getByLabelText('upload schema title'), new File([], 'test-file2.pdf', { type: 'application/pdf' }))];
|
|
264
264
|
case 2:
|
|
@@ -296,15 +296,15 @@ describe('Given a multiple file upload schema', function () {
|
|
|
296
296
|
{
|
|
297
297
|
type: 'button',
|
|
298
298
|
title: 'Submit',
|
|
299
|
-
action: { url: '/submit', method: 'POST' }
|
|
299
|
+
action: { url: '/submit', method: 'POST' },
|
|
300
300
|
},
|
|
301
301
|
],
|
|
302
302
|
schemas: [
|
|
303
303
|
getMultipleFileUploadSchemaObject(getArraySchema({ minItems: 2, maxItems: 2 })),
|
|
304
304
|
],
|
|
305
305
|
model: {},
|
|
306
|
-
errors: {}
|
|
307
|
-
}
|
|
306
|
+
errors: {},
|
|
307
|
+
},
|
|
308
308
|
});
|
|
309
309
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, props)));
|
|
310
310
|
return [4 /*yield*/, user.upload(screen.getByLabelText('upload schema title'), testFile)];
|
|
@@ -327,7 +327,7 @@ describe('Given a multiple file upload schema', function () {
|
|
|
327
327
|
switch (_a.label) {
|
|
328
328
|
case 0:
|
|
329
329
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, getProps({
|
|
330
|
-
initialStep: __assign(__assign({}, initialStep), { schemas: [getMultipleFileUploadSchemaObjectWithoutId()] })
|
|
330
|
+
initialStep: __assign(__assign({}, initialStep), { schemas: [getMultipleFileUploadSchemaObjectWithoutId()] }),
|
|
331
331
|
}))));
|
|
332
332
|
return [4 /*yield*/, user.upload(screen.getByLabelText('upload schema title'), testFile)];
|
|
333
333
|
case 1:
|
|
@@ -354,12 +354,12 @@ describe('Given a multiple file upload schema', function () {
|
|
|
354
354
|
return ({
|
|
355
355
|
ok: true,
|
|
356
356
|
status: 200,
|
|
357
|
-
json: jest.fn().mockResolvedValue((_a = {}, _a[idProperty] = "mockFileId".concat(it++), _a))
|
|
357
|
+
json: jest.fn().mockResolvedValue((_a = {}, _a[idProperty] = "mockFileId".concat(it++), _a)),
|
|
358
358
|
});
|
|
359
359
|
});
|
|
360
360
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, getProps({
|
|
361
361
|
initialStep: __assign(__assign({}, initialStep), { schemas: [getMultipleFileUploadSchemaObjectWithoutId()] }),
|
|
362
|
-
httpClient: mockHttpClient
|
|
362
|
+
httpClient: mockHttpClient,
|
|
363
363
|
}))));
|
|
364
364
|
onEvent.mockClear();
|
|
365
365
|
// upload 4 items
|
|
@@ -388,7 +388,7 @@ describe('Given a multiple file upload schema', function () {
|
|
|
388
388
|
_a.sent();
|
|
389
389
|
return [4 /*yield*/, waitFor(function () {
|
|
390
390
|
return expect(mockHttpClient).toHaveBeenCalledWith('/submit', expect.objectContaining({
|
|
391
|
-
body: JSON.stringify({ files: ['mockFileId0', 'mockFileId1', 'mockFileId2'] })
|
|
391
|
+
body: JSON.stringify({ files: ['mockFileId0', 'mockFileId1', 'mockFileId2'] }),
|
|
392
392
|
}));
|
|
393
393
|
})];
|
|
394
394
|
case 7:
|
|
@@ -62,17 +62,17 @@ describe('Object Schemas', function () {
|
|
|
62
62
|
properties: {
|
|
63
63
|
name: {
|
|
64
64
|
title: 'Name',
|
|
65
|
-
type: 'string'
|
|
65
|
+
type: 'string',
|
|
66
66
|
},
|
|
67
67
|
age: {
|
|
68
68
|
title: 'Age',
|
|
69
|
-
type: 'number'
|
|
69
|
+
type: 'number',
|
|
70
70
|
},
|
|
71
71
|
address: {
|
|
72
72
|
title: 'Address',
|
|
73
|
-
type: 'string'
|
|
74
|
-
}
|
|
75
|
-
}
|
|
73
|
+
type: 'string',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
76
|
};
|
|
77
77
|
var model = { name: 'Colin Robinson', address: '123 Fake Street' };
|
|
78
78
|
var errors = {
|
|
@@ -80,8 +80,8 @@ describe('Object Schemas', function () {
|
|
|
80
80
|
validation: {
|
|
81
81
|
name: 'Name should not be of a vampire',
|
|
82
82
|
age: 'Vampires can get really old',
|
|
83
|
-
address: 'Address should not be of a vampire'
|
|
84
|
-
}
|
|
83
|
+
address: 'Address should not be of a vampire',
|
|
84
|
+
},
|
|
85
85
|
};
|
|
86
86
|
var initialStep = {
|
|
87
87
|
id: 'object-schema-test-step-id',
|
|
@@ -91,12 +91,12 @@ describe('Object Schemas', function () {
|
|
|
91
91
|
{
|
|
92
92
|
type: 'button',
|
|
93
93
|
title: 'Submit',
|
|
94
|
-
action: { url: '/submit', method: 'POST' }
|
|
94
|
+
action: { url: '/submit', method: 'POST' },
|
|
95
95
|
},
|
|
96
96
|
],
|
|
97
97
|
schemas: [schema],
|
|
98
98
|
model: model,
|
|
99
|
-
errors: errors
|
|
99
|
+
errors: errors,
|
|
100
100
|
};
|
|
101
101
|
var getProps = function (overrides) {
|
|
102
102
|
if (overrides === void 0) { overrides = {}; }
|
|
@@ -168,7 +168,7 @@ describe('Object Schemas', function () {
|
|
|
168
168
|
switch (_a.label) {
|
|
169
169
|
case 0:
|
|
170
170
|
props = getProps({
|
|
171
|
-
initialStep: __assign(__assign({}, initialStep), { model: { name: 'Colin Robinson' } })
|
|
171
|
+
initialStep: __assign(__assign({}, initialStep), { model: { name: 'Colin Robinson' } }),
|
|
172
172
|
});
|
|
173
173
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, props)));
|
|
174
174
|
return [4 /*yield*/, user.clear(screen.getByLabelText('Name'))];
|
|
@@ -194,9 +194,9 @@ describe('Object Schemas', function () {
|
|
|
194
194
|
initialStep: __assign(__assign({}, initialStep), { schemas: [
|
|
195
195
|
__assign(__assign({}, schema), { alert: {
|
|
196
196
|
context: 'neutral',
|
|
197
|
-
markdown: 'This is an alert'
|
|
197
|
+
markdown: 'This is an alert',
|
|
198
198
|
} }),
|
|
199
|
-
] })
|
|
199
|
+
] }),
|
|
200
200
|
});
|
|
201
201
|
it('renders the alert', function () {
|
|
202
202
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, props)));
|
|
@@ -207,7 +207,7 @@ describe('Object Schemas', function () {
|
|
|
207
207
|
describe('when displayOrder property is present (it should always be)', function () {
|
|
208
208
|
describe('when displayOrder contains all properties', function () {
|
|
209
209
|
var props = getProps({
|
|
210
|
-
initialStep: __assign(__assign({}, initialStep), { schemas: [__assign(__assign({}, schema), { displayOrder: ['address', 'age', 'name'] })] })
|
|
210
|
+
initialStep: __assign(__assign({}, initialStep), { schemas: [__assign(__assign({}, schema), { displayOrder: ['address', 'age', 'name'] })] }),
|
|
211
211
|
});
|
|
212
212
|
it('renders the fields in the order specified', function () {
|
|
213
213
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, props)));
|
|
@@ -223,7 +223,7 @@ describe('Object Schemas', function () {
|
|
|
223
223
|
});
|
|
224
224
|
describe('when displayOrder contains only a subset of properties', function () {
|
|
225
225
|
var props = getProps({
|
|
226
|
-
initialStep: __assign(__assign({}, initialStep), { schemas: [__assign(__assign({}, schema), { displayOrder: ['address', 'name'] })] })
|
|
226
|
+
initialStep: __assign(__assign({}, initialStep), { schemas: [__assign(__assign({}, schema), { displayOrder: ['address', 'name'] })] }),
|
|
227
227
|
});
|
|
228
228
|
// TODO: this behaviour will be changed to match iOS implementation
|
|
229
229
|
it('renders any properties not specified in the display order in their natural order', function () {
|
|
@@ -239,7 +239,7 @@ describe('Object Schemas', function () {
|
|
|
239
239
|
});
|
|
240
240
|
describe('when displayOrder contains a property that does not exist', function () {
|
|
241
241
|
var props = getProps({
|
|
242
|
-
initialStep: __assign(__assign({}, initialStep), { schemas: [__assign(__assign({}, schema), { displayOrder: ['address', 'name', 'invalid'] })] })
|
|
242
|
+
initialStep: __assign(__assign({}, initialStep), { schemas: [__assign(__assign({}, schema), { displayOrder: ['address', 'name', 'invalid'] })] }),
|
|
243
243
|
});
|
|
244
244
|
it('does not attempt to render the property', function () {
|
|
245
245
|
renderWithProviders(_jsx(DynamicFlow, __assign({}, props)));
|
|
@@ -253,7 +253,7 @@ describe('Object Schemas', function () {
|
|
|
253
253
|
});
|
|
254
254
|
describe('when displayOrder property is missing', function () {
|
|
255
255
|
var props = getProps({
|
|
256
|
-
initialStep: __assign(__assign({}, initialStep), { schemas: [__assign(__assign({}, schema), { displayOrder: undefined })] })
|
|
256
|
+
initialStep: __assign(__assign({}, initialStep), { schemas: [__assign(__assign({}, schema), { displayOrder: undefined })] }),
|
|
257
257
|
});
|
|
258
258
|
// TODO: this will be changed to match iOS implementation
|
|
259
259
|
it('renders the fields in their "natural" order', function () {
|