@redocly/openapi-docs 3.24.1 → 3.25.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{redocly-openapi-docs.min.AiChatProvider-j-VDfFJ9.js → redocly-openapi-docs.min.AiChatProvider-CDMc3dS6.js} +1 -1
- package/dist/{redocly-openapi-docs.min.AiChatSqliteDBStorage-BBRBmffc.js → redocly-openapi-docs.min.AiChatSqliteDBStorage-BopXqcPv.js} +1 -1
- package/dist/{redocly-openapi-docs.min.AiPanel-DTzHqAiI.js → redocly-openapi-docs.min.AiPanel-DkXOeLs5.js} +1 -1
- package/dist/redocly-openapi-docs.min.FileWatcher-DMjNW66W.js +1 -0
- package/dist/{redocly-openapi-docs.min.SemanticSearchService-DNFOPBZK.js → redocly-openapi-docs.min.SemanticSearchService-DbpnWseN.js} +1 -1
- package/dist/{redocly-openapi-docs.min.SqliteDBStorage-Dy40Vq04.js → redocly-openapi-docs.min.SqliteDBStorage-ak3Zqgtw.js} +1 -1
- package/dist/{redocly-openapi-docs.min.TauriFileSystemAdapter-CpViFqJQ.js → redocly-openapi-docs.min.TauriFileSystemAdapter-Dl2fY3am.js} +1 -1
- package/dist/{redocly-openapi-docs.min.TauriRootStorage-TCUrp2uB.js → redocly-openapi-docs.min.TauriRootStorage-m4plsfqx.js} +1 -1
- package/dist/{redocly-openapi-docs.min.ai-chat-mappers-CmX-8902.js → redocly-openapi-docs.min.ai-chat-mappers-Dg8U8w8r.js} +1 -1
- package/dist/{redocly-openapi-docs.min.external-resolver-BkceRyB4.js → redocly-openapi-docs.min.external-resolver-Db7hewsm.js} +1 -1
- package/dist/{redocly-openapi-docs.min.index-BCcol5vU.js → redocly-openapi-docs.min.index-B5-R6EGY.js} +1 -1
- package/dist/{redocly-openapi-docs.min.index-CmXZfuiZ.js → redocly-openapi-docs.min.index-D9U4Tk7n.js} +1320 -1213
- package/dist/{redocly-openapi-docs.min.index-DVWw0ICA.js → redocly-openapi-docs.min.index-DeHk4n2z.js} +1 -1
- package/dist/{redocly-openapi-docs.min.index-C6uU_v-b.js → redocly-openapi-docs.min.index-EVRmC_IQ.js} +1 -1
- package/dist/redocly-openapi-docs.min.js +1 -1
- package/dist/{redocly-openapi-docs.min.lint-2YpbCz3r.js → redocly-openapi-docs.min.lint-PvmGrAK3.js} +2 -2
- package/dist/{redocly-openapi-docs.min.lint-graphql-Bgfcu2tP.js → redocly-openapi-docs.min.lint-graphql-CMMhYVr_.js} +1 -1
- package/dist/{redocly-openapi-docs.min.respect-run-Ct8taisL.js → redocly-openapi-docs.min.respect-run-DgsYdmxw.js} +1 -1
- package/dist/{redocly-openapi-docs.min.standalone-BPCdJgtH.js → redocly-openapi-docs.min.standalone-D9becCWS.js} +708 -673
- package/dist/redocly-openapi-docs.min.tauri-path-Bv9A5DVf.js +1 -0
- package/dist/{redocly-openapi-docs.min.useAiChatQueries-t8oy8jik.js → redocly-openapi-docs.min.useAiChatQueries-Cb-1pa0w.js} +2 -2
- package/lib/telemetry/RedocTelemetry.js +1 -31
- package/package.json +5 -5
- package/dist/redocly-openapi-docs.min.FileWatcher-DDoyaS7A.js +0 -1
- package/dist/redocly-openapi-docs.min.tauri-path-CmqBCxGb.js +0 -1
- package/lib/components/ApiInfo/__tests__/ApiInfo.test.d.ts +0 -1
- package/lib/components/ApiInfo/__tests__/ApiInfo.test.js +0 -46
- package/lib/components/Callbacks/__tests__/Callbacks.test.d.ts +0 -1
- package/lib/components/Callbacks/__tests__/Callbacks.test.js +0 -46
- package/lib/components/Content/__tests__/useAutoScroll.test.d.ts +0 -1
- package/lib/components/Content/__tests__/useAutoScroll.test.js +0 -88
- package/lib/components/ContentItem/__tests__/useIsExpanded.test.d.ts +0 -1
- package/lib/components/ContentItem/__tests__/useIsExpanded.test.js +0 -123
- package/lib/components/ContentItems/__tests__/Items.test.d.ts +0 -1
- package/lib/components/ContentItems/__tests__/Items.test.js +0 -66
- package/lib/components/ContentItems/__tests__/VirtualList.test.d.ts +0 -1
- package/lib/components/ContentItems/__tests__/VirtualList.test.js +0 -135
- package/lib/components/Discriminator/__tests__/DiscriminatorDropdown.test.d.ts +0 -1
- package/lib/components/Discriminator/__tests__/DiscriminatorDropdown.test.js +0 -63
- package/lib/components/Download/__tests__/DownloadSpecification.test.d.ts +0 -1
- package/lib/components/Download/__tests__/DownloadSpecification.test.js +0 -52
- package/lib/components/ExpandAllButton/__tests__/ExpandAllButton.test.d.ts +0 -1
- package/lib/components/ExpandAllButton/__tests__/ExpandAllButton.test.js +0 -60
- package/lib/components/ExpandAllButton/__tests__/helpers.test.d.ts +0 -1
- package/lib/components/ExpandAllButton/__tests__/helpers.test.js +0 -133
- package/lib/components/Language/__tests__/LanguageDropdown.test.d.ts +0 -1
- package/lib/components/Language/__tests__/LanguageDropdown.test.js +0 -23
- package/lib/components/Markdown/__tests__/Markdown.test.d.ts +0 -1
- package/lib/components/Markdown/__tests__/Markdown.test.js +0 -34
- package/lib/components/McpOverview/__tests__/McpOverview.test.d.ts +0 -1
- package/lib/components/McpOverview/__tests__/McpOverview.test.js +0 -66
- package/lib/components/McpTool/__tests__/McpPrompt.test.d.ts +0 -1
- package/lib/components/McpTool/__tests__/McpPrompt.test.js +0 -57
- package/lib/components/McpTool/__tests__/McpResource.test.d.ts +0 -1
- package/lib/components/McpTool/__tests__/McpResource.test.js +0 -81
- package/lib/components/McpTool/__tests__/McpTool.test.d.ts +0 -1
- package/lib/components/McpTool/__tests__/McpTool.test.js +0 -82
- package/lib/components/MediaTypeSwitch/__tests__/MediaTypesSwitch.test.d.ts +0 -1
- package/lib/components/MediaTypeSwitch/__tests__/MediaTypesSwitch.test.js +0 -79
- package/lib/components/OperationItem/__tests__/OperationItem.test.d.ts +0 -1
- package/lib/components/OperationItem/__tests__/OperationItem.test.js +0 -70
- package/lib/components/OperationItem/__tests__/__mocks__/mock-intersection-observer.d.ts +0 -16
- package/lib/components/OperationItem/__tests__/__mocks__/mock-intersection-observer.js +0 -42
- package/lib/components/Overview/__tests__/Overview.test.d.ts +0 -1
- package/lib/components/Overview/__tests__/Overview.test.js +0 -59
- package/lib/components/PayloadSamples/__tests__/Example.test.d.ts +0 -1
- package/lib/components/PayloadSamples/__tests__/Example.test.js +0 -36
- package/lib/components/PayloadSamples/__tests__/ExampleValue.test.d.ts +0 -1
- package/lib/components/PayloadSamples/__tests__/ExampleValue.test.js +0 -197
- package/lib/components/PayloadSamples/__tests__/PayloadSamples.test.d.ts +0 -1
- package/lib/components/PayloadSamples/__tests__/PayloadSamples.test.js +0 -38
- package/lib/components/PropertyDetails/__tests__/Extensions.test.d.ts +0 -1
- package/lib/components/PropertyDetails/__tests__/Extensions.test.js +0 -21
- package/lib/components/PropertyDetails/__tests__/FieldDetail.test.d.ts +0 -1
- package/lib/components/PropertyDetails/__tests__/FieldDetail.test.js +0 -52
- package/lib/components/PropertyDetails/__tests__/FieldDetails.test.d.ts +0 -1
- package/lib/components/PropertyDetails/__tests__/FieldDetails.test.js +0 -191
- package/lib/components/PropertyDetails/__tests__/PropertyDetails.test.d.ts +0 -1
- package/lib/components/PropertyDetails/__tests__/PropertyDetails.test.js +0 -365
- package/lib/components/PropertyDetails/__tests__/cycleColorsByLevel.test.d.ts +0 -1
- package/lib/components/PropertyDetails/__tests__/cycleColorsByLevel.test.js +0 -23
- package/lib/components/RedoclyOpenAPIDocs/__tests__/AppProvider.test.d.ts +0 -1
- package/lib/components/RedoclyOpenAPIDocs/__tests__/AppProvider.test.js +0 -16
- package/lib/components/RedoclyOpenAPIDocs/__tests__/RedoclyOpenAPIDocs.test.d.ts +0 -1
- package/lib/components/RedoclyOpenAPIDocs/__tests__/RedoclyOpenAPIDocs.test.js +0 -104
- package/lib/components/RenderHook/__tests__/RenderHook.test.d.ts +0 -1
- package/lib/components/RenderHook/__tests__/RenderHook.test.js +0 -15
- package/lib/components/Replay/__tests__/utils.test.d.ts +0 -1
- package/lib/components/Replay/__tests__/utils.test.js +0 -526
- package/lib/components/Request/__tests__/RequestDetails.test.d.ts +0 -1
- package/lib/components/Request/__tests__/RequestDetails.test.js +0 -98
- package/lib/components/RequestSamples/__tests__/Example.test.d.ts +0 -1
- package/lib/components/RequestSamples/__tests__/Example.test.js +0 -384
- package/lib/components/RequestSamples/__tests__/RequestSamples.test.d.ts +0 -1
- package/lib/components/RequestSamples/__tests__/RequestSamples.test.js +0 -226
- package/lib/components/RequestSamples/__tests__/useCodeSamples.test.d.ts +0 -1
- package/lib/components/RequestSamples/__tests__/useCodeSamples.test.js +0 -64
- package/lib/components/ResponseSamples/__tests__/ResponseSamples.test.d.ts +0 -1
- package/lib/components/ResponseSamples/__tests__/ResponseSamples.test.js +0 -29
- package/lib/components/Responses/__tests__/OperationResponseList.test.d.ts +0 -1
- package/lib/components/Responses/__tests__/OperationResponseList.test.js +0 -89
- package/lib/components/Responses/__tests__/ResponseDetails.test.d.ts +0 -1
- package/lib/components/Responses/__tests__/ResponseDetails.test.js +0 -111
- package/lib/components/Responses/__tests__/ResponsesHeaders.test.d.ts +0 -1
- package/lib/components/Responses/__tests__/ResponsesHeaders.test.js +0 -26
- package/lib/components/Schema/__tests__/ArraySchema.test.d.ts +0 -1
- package/lib/components/Schema/__tests__/ArraySchema.test.js +0 -93
- package/lib/components/Schema/__tests__/ObjectSchema.test.d.ts +0 -1
- package/lib/components/Schema/__tests__/ObjectSchema.test.js +0 -115
- package/lib/components/Schema/__tests__/OneOfSchema.test.d.ts +0 -1
- package/lib/components/Schema/__tests__/OneOfSchema.test.js +0 -33
- package/lib/components/Schema/__tests__/Schema.test.d.ts +0 -1
- package/lib/components/Schema/__tests__/Schema.test.js +0 -67
- package/lib/components/Schema/__tests__/useOneOfLocationIdx.test.d.ts +0 -1
- package/lib/components/Schema/__tests__/useOneOfLocationIdx.test.js +0 -22
- package/lib/components/SchemaCatalogLink/__tests__/SchemaCatalogLink.test.d.ts +0 -1
- package/lib/components/SchemaCatalogLink/__tests__/SchemaCatalogLink.test.js +0 -95
- package/lib/components/Security/__tests__/Security.test.d.ts +0 -1
- package/lib/components/Security/__tests__/Security.test.js +0 -38
- package/lib/components/Security/__tests__/SecurityButton.test.d.ts +0 -1
- package/lib/components/Security/__tests__/SecurityButton.test.js +0 -92
- package/lib/components/Security/__tests__/SecurityModal.test.d.ts +0 -1
- package/lib/components/Security/__tests__/SecurityModal.test.js +0 -172
- package/lib/components/ServerList/__tests__/ServerList.test.d.ts +0 -1
- package/lib/components/ServerList/__tests__/ServerList.test.js +0 -83
- package/lib/components/Tabs/__tests__/Tabs.test.d.ts +0 -1
- package/lib/components/Tabs/__tests__/Tabs.test.js +0 -27
- package/lib/components/ViewNested/__tests__/ViewNested.test.d.ts +0 -1
- package/lib/components/ViewNested/__tests__/ViewNested.test.js +0 -42
- package/lib/components/__tests__/Samples/ExampleSwitch.test.d.ts +0 -1
- package/lib/components/__tests__/Samples/ExampleSwitch.test.js +0 -45
- package/lib/components/__tests__/Samples/use-example-key.test.d.ts +0 -1
- package/lib/components/__tests__/Samples/use-example-key.test.js +0 -28
- package/lib/components/__tests__/common/ClearButton.test.d.ts +0 -1
- package/lib/components/__tests__/common/ClearButton.test.js +0 -18
- package/lib/components/__tests__/common/Dropdown.test.d.ts +0 -1
- package/lib/components/__tests__/common/Dropdown.test.js +0 -52
- package/lib/components/__tests__/mocks/examples.d.ts +0 -4
- package/lib/components/__tests__/mocks/examples.js +0 -115
- package/lib/components/common/__tests__/Dropdown.test.d.ts +0 -1
- package/lib/components/common/__tests__/Dropdown.test.js +0 -129
- package/lib/components/common/__tests__/LinkToField.test.d.ts +0 -1
- package/lib/components/common/__tests__/LinkToField.test.js +0 -39
- package/lib/jotai/__tests__/app.test.d.ts +0 -1
- package/lib/jotai/__tests__/app.test.js +0 -53
- package/lib/models/__tests__/Callback.test.d.ts +0 -1
- package/lib/models/__tests__/Callback.test.js +0 -15
- package/lib/models/__tests__/FieldModel.test.d.ts +0 -1
- package/lib/models/__tests__/FieldModel.test.js +0 -117
- package/lib/models/__tests__/MediaContent.test.d.ts +0 -1
- package/lib/models/__tests__/MediaContent.test.js +0 -105
- package/lib/models/__tests__/Operation.test.d.ts +0 -1
- package/lib/models/__tests__/Operation.test.js +0 -459
- package/lib/models/__tests__/Response.test.d.ts +0 -1
- package/lib/models/__tests__/Response.test.js +0 -221
- package/lib/models/__tests__/Schema.circular.test.d.ts +0 -1
- package/lib/models/__tests__/Schema.circular.test.js +0 -694
- package/lib/models/__tests__/Schema.test.d.ts +0 -1
- package/lib/models/__tests__/Schema.test.js +0 -1395
- package/lib/models/__tests__/example.test.d.ts +0 -1
- package/lib/models/__tests__/example.test.js +0 -90
- package/lib/models/__tests__/group.test.d.ts +0 -1
- package/lib/models/__tests__/group.test.js +0 -52
- package/lib/models/__tests__/helpers.d.ts +0 -5
- package/lib/models/__tests__/helpers.js +0 -62
- package/lib/models/__tests__/request.test.d.ts +0 -1
- package/lib/models/__tests__/request.test.js +0 -119
- package/lib/services/__tests__/OpenAPIParser.test.d.ts +0 -1
- package/lib/services/__tests__/OpenAPIParser.test.js +0 -80
- package/lib/services/__tests__/check.test.d.ts +0 -1
- package/lib/services/__tests__/check.test.js +0 -22
- package/lib/services/__tests__/utils.test.d.ts +0 -1
- package/lib/services/__tests__/utils.test.js +0 -42
- package/lib/services/code-samples/__tests__/apply-environments.test.d.ts +0 -1
- package/lib/services/code-samples/__tests__/apply-environments.test.js +0 -64
- package/lib/services/code-samples/__tests__/build-code-samples.test.d.ts +0 -1
- package/lib/services/code-samples/__tests__/build-code-samples.test.js +0 -70
- package/lib/services/code-samples/__tests__/convertSampleToString.test.d.ts +0 -1
- package/lib/services/code-samples/__tests__/convertSampleToString.test.js +0 -116
- package/lib/services/code-samples/__tests__/generator-data-value.test.d.ts +0 -1
- package/lib/services/code-samples/__tests__/generator-data-value.test.js +0 -277
- package/lib/services/code-samples/__tests__/generator-serialized-value.test.d.ts +0 -1
- package/lib/services/code-samples/__tests__/generator-serialized-value.test.js +0 -258
- package/lib/services/code-samples/__tests__/generator-value.test.d.ts +0 -1
- package/lib/services/code-samples/__tests__/generator-value.test.js +0 -273
- package/lib/services/code-samples/__tests__/generator.test.d.ts +0 -249
- package/lib/services/code-samples/__tests__/generator.test.js +0 -1201
- package/lib/services/code-samples/__tests__/get-example-value-by-mime-type.test.d.ts +0 -1
- package/lib/services/code-samples/__tests__/get-example-value-by-mime-type.test.js +0 -31
- package/lib/services/code-samples/httpsnippet/__tests__/device-authorization.test.d.ts +0 -1
- package/lib/services/code-samples/httpsnippet/__tests__/device-authorization.test.js +0 -222
- package/lib/services/code-samples/httpsnippet/helpers/__tests__/code-helpers.test.d.ts +0 -1
- package/lib/services/code-samples/httpsnippet/helpers/__tests__/code-helpers.test.js +0 -129
- package/lib/services/code-samples/httpsnippet/helpers/__tests__/string-utility.test.d.ts +0 -1
- package/lib/services/code-samples/httpsnippet/helpers/__tests__/string-utility.test.js +0 -49
- package/lib/services/code-samples/httpsnippet/targets/csharp/__tests__/httpclient.test.d.ts +0 -1
- package/lib/services/code-samples/httpsnippet/targets/csharp/__tests__/httpclient.test.js +0 -172
- package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/__tests__/httpclient.test.d.ts +0 -1
- package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/__tests__/httpclient.test.js +0 -172
- package/lib/services/code-samples/httpsnippet/targets/go/__tests__/native.test.d.ts +0 -1
- package/lib/services/code-samples/httpsnippet/targets/go/__tests__/native.test.js +0 -130
- package/lib/services/code-samples/httpsnippet/targets/java/__tests__/httpclient.test.d.ts +0 -1
- package/lib/services/code-samples/httpsnippet/targets/java/__tests__/httpclient.test.js +0 -191
- package/lib/services/code-samples/httpsnippet/targets/java8/__tests__/apachehttp.test.d.ts +0 -1
- package/lib/services/code-samples/httpsnippet/targets/java8/__tests__/apachehttp.test.js +0 -172
- package/lib/services/code-samples/httpsnippet/targets/javascript/__tests__/fetch.test.d.ts +0 -1
- package/lib/services/code-samples/httpsnippet/targets/javascript/__tests__/fetch.test.js +0 -85
- package/lib/services/code-samples/httpsnippet/targets/node/__tests__/fetch.test.d.ts +0 -1
- package/lib/services/code-samples/httpsnippet/targets/node/__tests__/fetch.test.js +0 -85
- package/lib/services/code-samples/httpsnippet/targets/php/__tests__/curl.test.d.ts +0 -1
- package/lib/services/code-samples/httpsnippet/targets/php/__tests__/curl.test.js +0 -126
- package/lib/services/code-samples/httpsnippet/targets/python/__tests__/requests.test.d.ts +0 -1
- package/lib/services/code-samples/httpsnippet/targets/python/__tests__/requests.test.js +0 -105
- package/lib/services/code-samples/httpsnippet/targets/r/__tests__/httr.test.d.ts +0 -1
- package/lib/services/code-samples/httpsnippet/targets/r/__tests__/httr.test.js +0 -126
- package/lib/services/code-samples/httpsnippet/targets/ruby/__tests__/native.test.d.ts +0 -1
- package/lib/services/code-samples/httpsnippet/targets/ruby/__tests__/native.test.js +0 -129
- package/lib/services/code-samples/httpsnippet/targets/shell/__tests__/curl.test.d.ts +0 -1
- package/lib/services/code-samples/httpsnippet/targets/shell/__tests__/curl.test.js +0 -129
- package/lib/services/config-options/__tests__/helpers.test.d.ts +0 -1
- package/lib/services/config-options/__tests__/helpers.test.js +0 -234
- package/lib/services/history/__tests__/helpers.test.d.ts +0 -1
- package/lib/services/history/__tests__/helpers.test.js +0 -19
- package/lib/services/menu/__tests__/buildNestedTagsItems.test.d.ts +0 -1
- package/lib/services/menu/__tests__/buildNestedTagsItems.test.js +0 -109
- package/lib/services/menu/__tests__/builder.test.d.ts +0 -1
- package/lib/services/menu/__tests__/builder.test.js +0 -307
- package/lib/services/menu/__tests__/operation.test.d.ts +0 -1
- package/lib/services/menu/__tests__/operation.test.js +0 -240
- package/lib/services/menu/__tests__/tags.test.d.ts +0 -1
- package/lib/services/menu/__tests__/tags.test.js +0 -71
- package/lib/telemetry/__tests__/RedocTelemetry.test.d.ts +0 -1
- package/lib/telemetry/__tests__/RedocTelemetry.test.js +0 -107
- package/lib/testProviders.d.ts +0 -6
- package/lib/testProviders.js +0 -14
- package/lib/utils/__tests__/areArraysEqual.test.d.ts +0 -1
- package/lib/utils/__tests__/areArraysEqual.test.js +0 -33
- package/lib/utils/__tests__/argValuesHelpers.d.ts +0 -1
- package/lib/utils/__tests__/argValuesHelpers.js +0 -56
- package/lib/utils/__tests__/calculateMaxLength.test.d.ts +0 -1
- package/lib/utils/__tests__/calculateMaxLength.test.js +0 -119
- package/lib/utils/__tests__/configure-helpers.test.d.ts +0 -1
- package/lib/utils/__tests__/configure-helpers.test.js +0 -356
- package/lib/utils/__tests__/convertSwagger2OpenAPI.test.d.ts +0 -1
- package/lib/utils/__tests__/convertSwagger2OpenAPI.test.js +0 -392
- package/lib/utils/__tests__/debounce.test.d.ts +0 -1
- package/lib/utils/__tests__/debounce.test.js +0 -54
- package/lib/utils/__tests__/debug.test.d.ts +0 -1
- package/lib/utils/__tests__/debug.test.js +0 -23
- package/lib/utils/__tests__/dom.test.d.ts +0 -1
- package/lib/utils/__tests__/dom.test.js +0 -108
- package/lib/utils/__tests__/getBreadcrumbs.test.d.ts +0 -1
- package/lib/utils/__tests__/getBreadcrumbs.test.js +0 -98
- package/lib/utils/__tests__/hasNestedFields.test.d.ts +0 -1
- package/lib/utils/__tests__/hasNestedFields.test.js +0 -147
- package/lib/utils/__tests__/helpers.test.d.ts +0 -1
- package/lib/utils/__tests__/helpers.test.js +0 -174
- package/lib/utils/__tests__/isMobile.test.d.ts +0 -1
- package/lib/utils/__tests__/isMobile.test.js +0 -28
- package/lib/utils/__tests__/loadAndBundleSpec.test.d.ts +0 -1
- package/lib/utils/__tests__/loadAndBundleSpec.test.js +0 -22
- package/lib/utils/__tests__/local-storage.test.d.ts +0 -1
- package/lib/utils/__tests__/local-storage.test.js +0 -48
- package/lib/utils/__tests__/object.test.d.ts +0 -1
- package/lib/utils/__tests__/object.test.js +0 -45
- package/lib/utils/__tests__/openapi.test.d.ts +0 -1
- package/lib/utils/__tests__/openapi.test.js +0 -1378
- package/lib/utils/__tests__/path.test.d.ts +0 -1
- package/lib/utils/__tests__/path.test.js +0 -16
- package/lib/utils/__tests__/queryString.test.d.ts +0 -1
- package/lib/utils/__tests__/queryString.test.js +0 -60
- package/lib/utils/__tests__/replaceVariables.test.d.ts +0 -1
- package/lib/utils/__tests__/replaceVariables.test.js +0 -46
- package/lib/utils/__tests__/simplifyAstStructure.test.d.ts +0 -1
- package/lib/utils/__tests__/simplifyAstStructure.test.js +0 -26
- package/lib/utils/__tests__/sort.test.d.ts +0 -1
- package/lib/utils/__tests__/sort.test.js +0 -16
- package/lib/utils/__tests__/string.test.d.ts +0 -1
- package/lib/utils/__tests__/string.test.js +0 -16
- package/lib/utils/__tests__/theme-helpers.test.d.ts +0 -1
- package/lib/utils/__tests__/theme-helpers.test.js +0 -24
- package/lib/utils/__tests__/url.test.d.ts +0 -1
- package/lib/utils/__tests__/url.test.js +0 -134
|
@@ -1,365 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { render, fireEvent, screen, act } from '@testing-library/react';
|
|
3
|
-
import * as Jotai from 'jotai';
|
|
4
|
-
import { PropertyDetails } from '../PropertyDetails.js';
|
|
5
|
-
import { normalizeOptions, OpenAPIParser } from '../../../services/index.js';
|
|
6
|
-
import { getField } from '../../../models/index.js';
|
|
7
|
-
import spec from './fixtures/fields.json';
|
|
8
|
-
import { TestBrowserRouter } from '../../../testProviders.js';
|
|
9
|
-
vi.mock('jotai', async () => ({
|
|
10
|
-
...(await vi.importActual('jotai')),
|
|
11
|
-
useAtomValue: vi.fn(),
|
|
12
|
-
}));
|
|
13
|
-
describe('Components', () => {
|
|
14
|
-
const options = normalizeOptions({});
|
|
15
|
-
const parser = new OpenAPIParser(spec, undefined, options);
|
|
16
|
-
const deps = { operation: { pointer: 'defaultPointer' } };
|
|
17
|
-
vi.spyOn(Jotai, 'useAtomValue').mockReturnValue(options);
|
|
18
|
-
it('should render FieldDetails without duplicate content', () => {
|
|
19
|
-
const field = getField(parser, {
|
|
20
|
-
$ref: '#/components/schemas/primitiveSchema',
|
|
21
|
-
}, '', options, deps);
|
|
22
|
-
render(_jsx(PropertyDetails, { field: field }), {
|
|
23
|
-
wrapper: TestBrowserRouter,
|
|
24
|
-
});
|
|
25
|
-
const occurrences = screen.getAllByText('any');
|
|
26
|
-
expect(occurrences.length).toBe(1);
|
|
27
|
-
});
|
|
28
|
-
it('should render FieldDetails with object schema', () => {
|
|
29
|
-
const field = getField(parser, {
|
|
30
|
-
$ref: '#/components/objectSchema',
|
|
31
|
-
}, '', options, deps);
|
|
32
|
-
const { getAllByText, queryByText, getByText } = render(_jsx(PropertyDetails, { field: field }), {
|
|
33
|
-
wrapper: TestBrowserRouter,
|
|
34
|
-
});
|
|
35
|
-
expect(queryByText('Show 2 properties')).not.toBeNull();
|
|
36
|
-
act(() => {
|
|
37
|
-
queryByText('Show 2 properties')?.click();
|
|
38
|
-
});
|
|
39
|
-
expect(getByText('status')).toBeInTheDocument();
|
|
40
|
-
expect(getByText('name')).toBeInTheDocument();
|
|
41
|
-
expect(getAllByText('string').length).toBe(2);
|
|
42
|
-
act(() => {
|
|
43
|
-
fireEvent.click(getByText('-'));
|
|
44
|
-
});
|
|
45
|
-
expect(getAllByText('Show 2 properties').length).toBe(1);
|
|
46
|
-
});
|
|
47
|
-
it('should render FieldDetails with Array of string schema', () => {
|
|
48
|
-
const field = getField(parser, {
|
|
49
|
-
$ref: '#/components/arraySchema',
|
|
50
|
-
name: 'test',
|
|
51
|
-
}, '', options, deps);
|
|
52
|
-
const { getByText } = render(_jsx(PropertyDetails, { field: field }), {
|
|
53
|
-
wrapper: TestBrowserRouter,
|
|
54
|
-
});
|
|
55
|
-
expect(getByText('Array of strings')).toBeInTheDocument();
|
|
56
|
-
});
|
|
57
|
-
it('should render FieldDetails with Array of object schema', () => {
|
|
58
|
-
const field = getField(parser, {
|
|
59
|
-
$ref: '#/components/arrayOfObjectsSchema',
|
|
60
|
-
name: 'test',
|
|
61
|
-
}, '', options, deps);
|
|
62
|
-
const { getByText, container } = render(_jsx(PropertyDetails, { field: field, level: 2 }), {
|
|
63
|
-
wrapper: TestBrowserRouter,
|
|
64
|
-
});
|
|
65
|
-
expect(getByText('Array of objects')).toBeInTheDocument();
|
|
66
|
-
expect(getByText('Show 2 array properties')).toBeInTheDocument();
|
|
67
|
-
act(() => {
|
|
68
|
-
fireEvent.click(getByText('Show 2 array properties'));
|
|
69
|
-
});
|
|
70
|
-
expect(getByText('status')).toBeInTheDocument();
|
|
71
|
-
expect(getByText('name')).toBeInTheDocument();
|
|
72
|
-
expect(container.textContent.includes('test[].\u200Bname')).toBe(true);
|
|
73
|
-
expect(container.textContent.includes('test[].\u200Bstatus')).toBe(true);
|
|
74
|
-
});
|
|
75
|
-
it('should render array of primitive items with own documentation as a nested items row', () => {
|
|
76
|
-
const field = getField(parser, {
|
|
77
|
-
name: 'owners',
|
|
78
|
-
schema: {
|
|
79
|
-
type: 'array',
|
|
80
|
-
minItems: 1,
|
|
81
|
-
maxItems: 20,
|
|
82
|
-
description: 'List of ACL groups.',
|
|
83
|
-
items: {
|
|
84
|
-
type: 'string',
|
|
85
|
-
format: 'email',
|
|
86
|
-
maxLength: 256,
|
|
87
|
-
pattern: '^\\S+@\\S+$',
|
|
88
|
-
description: 'ACL group formatted as an email.',
|
|
89
|
-
example: 'john@example.com',
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
}, '', options, deps);
|
|
93
|
-
const { getByText, queryByText, container } = render(_jsx(PropertyDetails, { field: field, level: 2 }), {
|
|
94
|
-
wrapper: TestBrowserRouter,
|
|
95
|
-
});
|
|
96
|
-
expect(getByText('Array of strings')).toBeInTheDocument();
|
|
97
|
-
expect(getByText('[ 1 .. 20 ] items')).toBeInTheDocument();
|
|
98
|
-
expect(getByText('List of ACL groups.')).toBeInTheDocument();
|
|
99
|
-
// items info is collapsed into the nested items row, including the items example
|
|
100
|
-
expect(queryByText('ACL group formatted as an email.')).not.toBeInTheDocument();
|
|
101
|
-
expect(queryByText('Example:')).not.toBeInTheDocument();
|
|
102
|
-
expect(getByText('Show array items')).toBeInTheDocument();
|
|
103
|
-
act(() => {
|
|
104
|
-
fireEvent.click(getByText('Show array items'));
|
|
105
|
-
});
|
|
106
|
-
expect(getByText('ACL group formatted as an email.')).toBeInTheDocument();
|
|
107
|
-
expect(getByText('<= 256 characters')).toBeInTheDocument();
|
|
108
|
-
expect(getByText('(email)')).toBeInTheDocument();
|
|
109
|
-
expect(getByText('"john@example.com"')).toBeInTheDocument();
|
|
110
|
-
// the items row is labeled `owners.[i]`, not `owners[].[i]`
|
|
111
|
-
expect(container.textContent.includes('owners.\u200B[i]')).toBe(true);
|
|
112
|
-
expect(container.textContent.includes('owners[]')).toBe(false);
|
|
113
|
-
});
|
|
114
|
-
it('should render a single deprecated badge for a deprecated primitive oneOf variant', () => {
|
|
115
|
-
const field = getField(parser, {
|
|
116
|
-
name: 'value',
|
|
117
|
-
schema: {
|
|
118
|
-
oneOf: [
|
|
119
|
-
{ type: 'string', deprecated: true, description: 'Legacy plain text value.' },
|
|
120
|
-
{ type: 'number' },
|
|
121
|
-
],
|
|
122
|
-
},
|
|
123
|
-
}, '', options, deps);
|
|
124
|
-
const { getAllByText } = render(_jsx(PropertyDetails, { field: field, level: 2 }), {
|
|
125
|
-
wrapper: TestBrowserRouter,
|
|
126
|
-
});
|
|
127
|
-
// OneOfSchema renders the badge for the active variant; the fallback row must not repeat it
|
|
128
|
-
expect(getAllByText('Deprecated')).toHaveLength(1);
|
|
129
|
-
});
|
|
130
|
-
it('should keep the items docs on the nested items row inside a oneOf variant', () => {
|
|
131
|
-
const field = getField(parser, {
|
|
132
|
-
name: 'value',
|
|
133
|
-
schema: {
|
|
134
|
-
oneOf: [
|
|
135
|
-
{
|
|
136
|
-
type: 'array',
|
|
137
|
-
items: {
|
|
138
|
-
type: 'string',
|
|
139
|
-
maxLength: 256,
|
|
140
|
-
description: 'ACL group formatted as an email.',
|
|
141
|
-
example: 'john@example.com',
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
{ type: 'string' },
|
|
145
|
-
],
|
|
146
|
-
},
|
|
147
|
-
}, '', options, deps);
|
|
148
|
-
const { getByText } = render(_jsx(PropertyDetails, { field: field, level: 2 }), {
|
|
149
|
-
wrapper: TestBrowserRouter,
|
|
150
|
-
});
|
|
151
|
-
act(() => {
|
|
152
|
-
fireEvent.click(getByText('Show array items'));
|
|
153
|
-
});
|
|
154
|
-
expect(getByText('ACL group formatted as an email.')).toBeInTheDocument();
|
|
155
|
-
expect(getByText('"john@example.com"')).toBeInTheDocument();
|
|
156
|
-
});
|
|
157
|
-
it('should index prefixItems rows without the [] marker on the parent name', () => {
|
|
158
|
-
const tupleParser = new OpenAPIParser({
|
|
159
|
-
openapi: '3.1.0',
|
|
160
|
-
components: {
|
|
161
|
-
schemas: {
|
|
162
|
-
AclGroup: {
|
|
163
|
-
type: 'string',
|
|
164
|
-
maxLength: 256,
|
|
165
|
-
description: 'OSDU Access Control List (ACL) group that controls data access.',
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
},
|
|
169
|
-
}, undefined, options);
|
|
170
|
-
const field = getField(tupleParser, {
|
|
171
|
-
name: 'owners',
|
|
172
|
-
schema: {
|
|
173
|
-
type: 'array',
|
|
174
|
-
minItems: 1,
|
|
175
|
-
maxItems: 20,
|
|
176
|
-
description: 'Description for property.',
|
|
177
|
-
example: ['data.default.owners@opendes.testing.slb.com'],
|
|
178
|
-
prefixItems: [
|
|
179
|
-
{
|
|
180
|
-
$ref: '#/components/schemas/AclGroup',
|
|
181
|
-
description: 'Sibling description for items 111.',
|
|
182
|
-
},
|
|
183
|
-
{ type: 'number', description: 'Description for second item. 222.' },
|
|
184
|
-
],
|
|
185
|
-
items: {
|
|
186
|
-
type: 'array',
|
|
187
|
-
description: 'Description for additional items.',
|
|
188
|
-
minItems: 2,
|
|
189
|
-
prefixItems: [
|
|
190
|
-
{ type: 'number', description: 'Description for first item. 111.' },
|
|
191
|
-
{ type: 'string', description: 'Description for second item. 222.' },
|
|
192
|
-
],
|
|
193
|
-
items: {
|
|
194
|
-
type: 'string',
|
|
195
|
-
description: 'Description for first item 333.',
|
|
196
|
-
maxLength: 256,
|
|
197
|
-
},
|
|
198
|
-
},
|
|
199
|
-
},
|
|
200
|
-
}, '', options, deps);
|
|
201
|
-
const { getByText, queryByText, container } = render(_jsx(PropertyDetails, { field: field, level: 2 }), {
|
|
202
|
-
wrapper: TestBrowserRouter,
|
|
203
|
-
});
|
|
204
|
-
expect(getByText('Array of items')).toBeInTheDocument();
|
|
205
|
-
expect(getByText('[ 1 .. 20 ] items')).toBeInTheDocument();
|
|
206
|
-
expect(getByText('Description for property.')).toBeInTheDocument();
|
|
207
|
-
// the array example is distributed across the item rows, not repeated on the array row
|
|
208
|
-
expect(screen.queryByTestId('json-viewer')).toBeNull();
|
|
209
|
-
act(() => {
|
|
210
|
-
fireEvent.click(getByText('Show 3 properties'));
|
|
211
|
-
});
|
|
212
|
-
expect(getByText('"data.default.owners@opendes.testing.slb.com"')).toBeInTheDocument();
|
|
213
|
-
// tuple members are indexed on the parent name without the [] marker
|
|
214
|
-
expect(container.textContent.includes('owners.\u200B[0]')).toBe(true);
|
|
215
|
-
expect(container.textContent.includes('owners.\u200B[1]')).toBe(true);
|
|
216
|
-
expect(container.textContent.includes('owners.\u200B[2...]')).toBe(true);
|
|
217
|
-
expect(container.textContent.includes('owners[]')).toBe(false);
|
|
218
|
-
// the $ref sibling description wins on the prefix item row
|
|
219
|
-
expect(getByText('Sibling description for items 111.')).toBeInTheDocument();
|
|
220
|
-
expect(queryByText('OSDU Access Control List (ACL) group that controls data access.')).not.toBeInTheDocument();
|
|
221
|
-
expect(getByText('(AclGroup)')).toBeInTheDocument();
|
|
222
|
-
expect(getByText('<= 256 characters')).toBeInTheDocument();
|
|
223
|
-
expect(getByText('Description for additional items.')).toBeInTheDocument();
|
|
224
|
-
// the additional items schema is a tuple itself; its rows are indexed the same way
|
|
225
|
-
act(() => {
|
|
226
|
-
fireEvent.click(getByText('Show 3 properties'));
|
|
227
|
-
});
|
|
228
|
-
expect(container.textContent.includes('owners.\u200B[2...].\u200B[0]')).toBe(true);
|
|
229
|
-
expect(container.textContent.includes('owners.\u200B[2...].\u200B[1]')).toBe(true);
|
|
230
|
-
expect(container.textContent.includes('owners.\u200B[2...].\u200B[2...]')).toBe(true);
|
|
231
|
-
expect(getByText('Description for first item 333.')).toBeInTheDocument();
|
|
232
|
-
});
|
|
233
|
-
it('should render nested tuples with empty and items-less member schemas', () => {
|
|
234
|
-
// mirrors the OpenAPI 3.2 nested multipart/mixed example
|
|
235
|
-
const field = getField(parser, {
|
|
236
|
-
name: 'parts',
|
|
237
|
-
schema: {
|
|
238
|
-
type: 'array',
|
|
239
|
-
prefixItems: [
|
|
240
|
-
{ type: 'array' },
|
|
241
|
-
{
|
|
242
|
-
type: 'array',
|
|
243
|
-
prefixItems: [{ type: 'object' }, { type: 'string' }, {}],
|
|
244
|
-
},
|
|
245
|
-
],
|
|
246
|
-
},
|
|
247
|
-
}, '', options, deps);
|
|
248
|
-
const { getByText, container } = render(_jsx(PropertyDetails, { field: field, level: 2 }), {
|
|
249
|
-
wrapper: TestBrowserRouter,
|
|
250
|
-
});
|
|
251
|
-
expect(getByText('Array of items')).toBeInTheDocument();
|
|
252
|
-
act(() => {
|
|
253
|
-
fireEvent.click(getByText('Show 2 properties'));
|
|
254
|
-
});
|
|
255
|
-
// an items-less array member accepts any items
|
|
256
|
-
expect(container.textContent.includes('parts.\u200B[0]')).toBe(true);
|
|
257
|
-
expect(getByText('Array of any')).toBeInTheDocument();
|
|
258
|
-
expect(container.textContent.includes('parts.\u200B[1]')).toBe(true);
|
|
259
|
-
act(() => {
|
|
260
|
-
fireEvent.click(getByText('Show 3 properties'));
|
|
261
|
-
});
|
|
262
|
-
expect(container.textContent.includes('parts.\u200B[1].\u200B[0]')).toBe(true);
|
|
263
|
-
expect(getByText('object')).toBeInTheDocument();
|
|
264
|
-
expect(container.textContent.includes('parts.\u200B[1].\u200B[1]')).toBe(true);
|
|
265
|
-
expect(getByText('string')).toBeInTheDocument();
|
|
266
|
-
// an empty {} member schema accepts anything
|
|
267
|
-
expect(container.textContent.includes('parts.\u200B[1].\u200B[2]')).toBe(true);
|
|
268
|
-
expect(getByText('any')).toBeInTheDocument();
|
|
269
|
-
expect(container.textContent.includes('parts[]')).toBe(false);
|
|
270
|
-
});
|
|
271
|
-
it('should render FieldDetails with oneOf schema with object schema', () => {
|
|
272
|
-
const field = getField(parser, {
|
|
273
|
-
$ref: '#/components/oneOfSchemaWithObjectSchema',
|
|
274
|
-
name: 'test',
|
|
275
|
-
}, '', options, deps);
|
|
276
|
-
const { getByText, container } = render(_jsx(PropertyDetails, { field: field, level: 2 }), {
|
|
277
|
-
wrapper: TestBrowserRouter,
|
|
278
|
-
});
|
|
279
|
-
expect(getByText('Show 2 properties')).toBeInTheDocument();
|
|
280
|
-
act(() => {
|
|
281
|
-
fireEvent.click(getByText('Show 2 properties'));
|
|
282
|
-
});
|
|
283
|
-
expect(getByText('status')).toBeInTheDocument();
|
|
284
|
-
expect(getByText('name')).toBeInTheDocument();
|
|
285
|
-
expect(container.textContent.includes('test.\u200Bname')).toBe(true);
|
|
286
|
-
expect(container.textContent.includes('test.\u200Bstatus')).toBe(true);
|
|
287
|
-
});
|
|
288
|
-
it('should render FieldDetails with a oneOf schema at the first level without nesting', () => {
|
|
289
|
-
const field = getField(parser, {
|
|
290
|
-
$ref: '#/components/oneOfSchemaWithObjectSchema',
|
|
291
|
-
name: 'test',
|
|
292
|
-
}, '', options, deps);
|
|
293
|
-
const { getByText, container } = render(_jsx(PropertyDetails, { field: field, level: 2 }), {
|
|
294
|
-
wrapper: TestBrowserRouter,
|
|
295
|
-
});
|
|
296
|
-
expect(getByText('Show 2 properties')).toBeInTheDocument();
|
|
297
|
-
act(() => {
|
|
298
|
-
fireEvent.click(getByText('Show 2 properties'));
|
|
299
|
-
});
|
|
300
|
-
expect(getByText('status')).toBeInTheDocument();
|
|
301
|
-
expect(getByText('name')).toBeInTheDocument();
|
|
302
|
-
expect(container.textContent.includes('test.\u200Bname')).toBe(true);
|
|
303
|
-
expect(container.textContent.includes('test.\u200Bstatus')).toBe(true);
|
|
304
|
-
});
|
|
305
|
-
it('the read-only field should be displayed', () => {
|
|
306
|
-
const field = getField(parser, {
|
|
307
|
-
$ref: '#/components/testProperties/readOnlyInSchema',
|
|
308
|
-
}, '', options, deps);
|
|
309
|
-
const { container } = render(_jsx(PropertyDetails, { field: field }), {
|
|
310
|
-
wrapper: TestBrowserRouter,
|
|
311
|
-
});
|
|
312
|
-
expect(container).toHaveTextContent(/read-only/);
|
|
313
|
-
});
|
|
314
|
-
it('the write-only field should be displayed', () => {
|
|
315
|
-
const field = getField(parser, {
|
|
316
|
-
$ref: '#/components/testProperties/writeOnlyInSchema',
|
|
317
|
-
}, '', options, deps);
|
|
318
|
-
const { container } = render(_jsx(PropertyDetails, { field: field }), {
|
|
319
|
-
wrapper: TestBrowserRouter,
|
|
320
|
-
});
|
|
321
|
-
expect(container).toHaveTextContent(/write-only/);
|
|
322
|
-
});
|
|
323
|
-
describe('PropertyDetails', () => {
|
|
324
|
-
it('PropertyDetails with read-only should renders correctly', () => {
|
|
325
|
-
options.showAccessMode = true;
|
|
326
|
-
const field = getField(parser, {
|
|
327
|
-
$ref: '#/components/testProperties/readOnlyInSchema',
|
|
328
|
-
}, '', options, deps);
|
|
329
|
-
const { container } = render(_jsx(PropertyDetails, { field: field }), {
|
|
330
|
-
wrapper: TestBrowserRouter,
|
|
331
|
-
});
|
|
332
|
-
expect(container).toHaveTextContent(/read-only/);
|
|
333
|
-
});
|
|
334
|
-
it('Field with write-only should renders correctly', () => {
|
|
335
|
-
options.showAccessMode = true;
|
|
336
|
-
const field = getField(parser, {
|
|
337
|
-
$ref: '#/components/testProperties/writeOnlyInSchema',
|
|
338
|
-
}, '', options, deps);
|
|
339
|
-
const { container } = render(_jsx(PropertyDetails, { field: field }), {
|
|
340
|
-
wrapper: TestBrowserRouter,
|
|
341
|
-
});
|
|
342
|
-
expect(container).toHaveTextContent(/write-only/);
|
|
343
|
-
});
|
|
344
|
-
it('Fields with read-only and write-only in content should renders correctly', async () => {
|
|
345
|
-
options.showAccessMode = true;
|
|
346
|
-
const field = getField(parser, {
|
|
347
|
-
name: 'test',
|
|
348
|
-
in: 'path',
|
|
349
|
-
content: {
|
|
350
|
-
'application/json': {
|
|
351
|
-
schema: {
|
|
352
|
-
$ref: '#/components/testProperties/readOnlyInContent',
|
|
353
|
-
},
|
|
354
|
-
},
|
|
355
|
-
},
|
|
356
|
-
}, '', options, deps);
|
|
357
|
-
const { container } = render(_jsx(PropertyDetails, { field: field }), {
|
|
358
|
-
wrapper: TestBrowserRouter,
|
|
359
|
-
});
|
|
360
|
-
fireEvent.click(await screen.getByText('Show 2 properties'));
|
|
361
|
-
expect(container).toHaveTextContent(/read-only/);
|
|
362
|
-
});
|
|
363
|
-
});
|
|
364
|
-
});
|
|
365
|
-
//# sourceMappingURL=PropertyDetails.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { cycleColorsByLevel } from '../cycleColorsByLevel.js';
|
|
2
|
-
describe('fieldColorByLevel', () => {
|
|
3
|
-
it('returns the correct color for a given level', () => {
|
|
4
|
-
const levelColors = [
|
|
5
|
-
'#9D00FF',
|
|
6
|
-
'#615CEA',
|
|
7
|
-
'#147DF5',
|
|
8
|
-
'#08BFCC',
|
|
9
|
-
'#08CC7A',
|
|
10
|
-
'#81CC08',
|
|
11
|
-
'#E5BE00',
|
|
12
|
-
'#FF8700',
|
|
13
|
-
'#FF00B8',
|
|
14
|
-
];
|
|
15
|
-
for (let i = 0; i < levelColors.length; i++) {
|
|
16
|
-
expect(cycleColorsByLevel(i)).toBe(levelColors[i]);
|
|
17
|
-
}
|
|
18
|
-
expect(cycleColorsByLevel(levelColors.length)).toBe(levelColors[0]);
|
|
19
|
-
expect(cycleColorsByLevel(levelColors.length + 1)).toBe(levelColors[1]);
|
|
20
|
-
expect(cycleColorsByLevel(levelColors.length * 2)).toBe(levelColors[0]);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
//# sourceMappingURL=cycleColorsByLevel.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import { StoreProvider } from '../Providers.js';
|
|
4
|
-
describe('ProStoreProvider', () => {
|
|
5
|
-
test('StoreProvider should run onInit hook', async () => {
|
|
6
|
-
const { findByTestId } = render(_jsx(StoreProvider, { options: {}, definition: {
|
|
7
|
-
openapi: '3.0.0',
|
|
8
|
-
info: {
|
|
9
|
-
version: '1.0',
|
|
10
|
-
title: 'Foo',
|
|
11
|
-
},
|
|
12
|
-
}, children: _jsx("div", { "data-testid": "test" }) }));
|
|
13
|
-
expect(await findByTestId('test')).toBeInTheDocument();
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
//# sourceMappingURL=AppProvider.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { parseYaml } from '@redocly/openapi-core';
|
|
3
|
-
import { readFileSync } from 'fs';
|
|
4
|
-
import { render, waitFor } from '@testing-library/react';
|
|
5
|
-
import { vi } from 'vitest';
|
|
6
|
-
import { createElement } from 'react';
|
|
7
|
-
import { MemoryRouter } from 'react-router';
|
|
8
|
-
import { useTelemetry } from '../../../hooks/index.js';
|
|
9
|
-
import { useSetAtom } from 'jotai';
|
|
10
|
-
vi.mock('../../../hooks/useTelemetry');
|
|
11
|
-
vi.mock('../../../hooks/useRouter', () => ({
|
|
12
|
-
useRouter: () => ({
|
|
13
|
-
Router: ({ children }) => createElement(MemoryRouter, {}, children),
|
|
14
|
-
routerProps: {},
|
|
15
|
-
}),
|
|
16
|
-
}));
|
|
17
|
-
vi.mock('@redocly/theme/core/openapi', async () => {
|
|
18
|
-
const actual = await vi.importActual('@redocly/theme/core/openapi');
|
|
19
|
-
return {
|
|
20
|
-
...actual,
|
|
21
|
-
getOperationColor: vi.fn(() => '#007bff'),
|
|
22
|
-
SearchSessionProvider: ({ children }) => {
|
|
23
|
-
const mockContextValue = {
|
|
24
|
-
searchSessionId: 'test-session-id',
|
|
25
|
-
refreshSearchSessionId: vi.fn(),
|
|
26
|
-
};
|
|
27
|
-
const Provider = actual.SearchSessionContext.Provider;
|
|
28
|
-
return createElement(Provider, { value: mockContextValue, children });
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
vi.mock('jotai', async () => {
|
|
33
|
-
const originalJotai = await vi.importActual('jotai');
|
|
34
|
-
return {
|
|
35
|
-
...originalJotai,
|
|
36
|
-
useSetAtom: vi.fn(),
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
import { RedoclyOpenAPIDocs } from '../RedoclyOpenAPIDocs.js';
|
|
40
|
-
const contents = readFileSync('./playground/openapi/petstore.yaml', 'utf8');
|
|
41
|
-
const definition = parseYaml(contents);
|
|
42
|
-
vi.mock('../../../hooks/useLicense', () => {
|
|
43
|
-
return {
|
|
44
|
-
useLicense: () => {
|
|
45
|
-
return {
|
|
46
|
-
licenseInfo: { valid: true, allowed: true },
|
|
47
|
-
isValid: true,
|
|
48
|
-
};
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
});
|
|
52
|
-
describe('RedoclyOpenAPIDocs', () => {
|
|
53
|
-
const options = {};
|
|
54
|
-
const store = { definition, options };
|
|
55
|
-
window.scrollTo = vi.fn();
|
|
56
|
-
const mockTelemetrySend = vi.fn();
|
|
57
|
-
beforeEach(() => {
|
|
58
|
-
vi.clearAllMocks();
|
|
59
|
-
useTelemetry.mockImplementation(() => ({
|
|
60
|
-
sendViewedMessage: mockTelemetrySend,
|
|
61
|
-
}));
|
|
62
|
-
useSetAtom.mockReturnValue(vi.fn());
|
|
63
|
-
});
|
|
64
|
-
describe('onLoaded callback', () => {
|
|
65
|
-
it('should call callback on mount', async () => {
|
|
66
|
-
const onLoaded = vi.fn();
|
|
67
|
-
render(_jsx(RedoclyOpenAPIDocs, { store: store, onLoaded: onLoaded }));
|
|
68
|
-
await waitFor(() => {
|
|
69
|
-
expect(onLoaded).toHaveBeenCalledTimes(1);
|
|
70
|
-
}, { timeout: 10_000 });
|
|
71
|
-
}, 15_000);
|
|
72
|
-
it('should return null if store is not provided', () => {
|
|
73
|
-
const { container } = render(_jsx(RedoclyOpenAPIDocs, {}));
|
|
74
|
-
expect(container.firstChild).toBeNull();
|
|
75
|
-
});
|
|
76
|
-
it('should not render sidebar if options.hideSidebar is true', () => {
|
|
77
|
-
const { queryByRole } = render(_jsx(RedoclyOpenAPIDocs, { store: { ...store, options: { ...options, hideSidebar: true } } }));
|
|
78
|
-
expect(queryByRole('complementary')).not.toBeInTheDocument();
|
|
79
|
-
});
|
|
80
|
-
it('should pass correct props to SidebarLogo when x-logo is defined', () => {
|
|
81
|
-
const xLogo = {
|
|
82
|
-
url: 'https://example.com/logo.png',
|
|
83
|
-
href: 'https://example.com',
|
|
84
|
-
altText: 'example logo',
|
|
85
|
-
backgroundColor: '#FFFFFF',
|
|
86
|
-
};
|
|
87
|
-
const definitionWithLogo = {
|
|
88
|
-
...definition,
|
|
89
|
-
info: { ...definition.info, 'x-logo': xLogo },
|
|
90
|
-
};
|
|
91
|
-
const { getByAltText } = render(_jsx(RedoclyOpenAPIDocs, { store: { ...store, definition: definitionWithLogo } }));
|
|
92
|
-
const logoImg = getByAltText(xLogo.altText);
|
|
93
|
-
expect(logoImg.src).toBe(xLogo.url);
|
|
94
|
-
expect(logoImg.parentElement?.getAttribute('href')).toBe(xLogo.href);
|
|
95
|
-
});
|
|
96
|
-
it('should not set operations when hideReplay is true', () => {
|
|
97
|
-
const setAllOperations = vi.fn();
|
|
98
|
-
useSetAtom.mockReturnValue(setAllOperations);
|
|
99
|
-
render(_jsx(RedoclyOpenAPIDocs, { store: { ...store, options: { ...options, hideReplay: true } } }));
|
|
100
|
-
expect(setAllOperations).not.toHaveBeenCalled();
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
//# sourceMappingURL=RedoclyOpenAPIDocs.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/* tslint:disable:no-implicit-dependencies */
|
|
3
|
-
import { render } from '@testing-library/react';
|
|
4
|
-
import { RenderHook } from '../RenderHook.js';
|
|
5
|
-
describe('RenderHook', () => {
|
|
6
|
-
it('should render correctly', () => {
|
|
7
|
-
const { container } = render(_jsx(RenderHook, { Hook: ({ someProp }) => ({ html: `<a href='#'>${someProp}</a>` }), props: { someProp: 'text' } }));
|
|
8
|
-
expect(container.innerHTML).toEqual('<span><a href="#">text</a></span>');
|
|
9
|
-
});
|
|
10
|
-
it("should return null if Hook prop isn't defined", () => {
|
|
11
|
-
const { container } = render(_jsx(RenderHook, { props: { someProp: 'text' } }));
|
|
12
|
-
expect(container.innerHTML).toEqual('');
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
//# sourceMappingURL=RenderHook.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|