@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.
Files changed (283) hide show
  1. package/dist/{redocly-openapi-docs.min.AiChatProvider-j-VDfFJ9.js → redocly-openapi-docs.min.AiChatProvider-CDMc3dS6.js} +1 -1
  2. package/dist/{redocly-openapi-docs.min.AiChatSqliteDBStorage-BBRBmffc.js → redocly-openapi-docs.min.AiChatSqliteDBStorage-BopXqcPv.js} +1 -1
  3. package/dist/{redocly-openapi-docs.min.AiPanel-DTzHqAiI.js → redocly-openapi-docs.min.AiPanel-DkXOeLs5.js} +1 -1
  4. package/dist/redocly-openapi-docs.min.FileWatcher-DMjNW66W.js +1 -0
  5. package/dist/{redocly-openapi-docs.min.SemanticSearchService-DNFOPBZK.js → redocly-openapi-docs.min.SemanticSearchService-DbpnWseN.js} +1 -1
  6. package/dist/{redocly-openapi-docs.min.SqliteDBStorage-Dy40Vq04.js → redocly-openapi-docs.min.SqliteDBStorage-ak3Zqgtw.js} +1 -1
  7. package/dist/{redocly-openapi-docs.min.TauriFileSystemAdapter-CpViFqJQ.js → redocly-openapi-docs.min.TauriFileSystemAdapter-Dl2fY3am.js} +1 -1
  8. package/dist/{redocly-openapi-docs.min.TauriRootStorage-TCUrp2uB.js → redocly-openapi-docs.min.TauriRootStorage-m4plsfqx.js} +1 -1
  9. package/dist/{redocly-openapi-docs.min.ai-chat-mappers-CmX-8902.js → redocly-openapi-docs.min.ai-chat-mappers-Dg8U8w8r.js} +1 -1
  10. package/dist/{redocly-openapi-docs.min.external-resolver-BkceRyB4.js → redocly-openapi-docs.min.external-resolver-Db7hewsm.js} +1 -1
  11. package/dist/{redocly-openapi-docs.min.index-BCcol5vU.js → redocly-openapi-docs.min.index-B5-R6EGY.js} +1 -1
  12. package/dist/{redocly-openapi-docs.min.index-CmXZfuiZ.js → redocly-openapi-docs.min.index-D9U4Tk7n.js} +1320 -1213
  13. package/dist/{redocly-openapi-docs.min.index-DVWw0ICA.js → redocly-openapi-docs.min.index-DeHk4n2z.js} +1 -1
  14. package/dist/{redocly-openapi-docs.min.index-C6uU_v-b.js → redocly-openapi-docs.min.index-EVRmC_IQ.js} +1 -1
  15. package/dist/redocly-openapi-docs.min.js +1 -1
  16. package/dist/{redocly-openapi-docs.min.lint-2YpbCz3r.js → redocly-openapi-docs.min.lint-PvmGrAK3.js} +2 -2
  17. package/dist/{redocly-openapi-docs.min.lint-graphql-Bgfcu2tP.js → redocly-openapi-docs.min.lint-graphql-CMMhYVr_.js} +1 -1
  18. package/dist/{redocly-openapi-docs.min.respect-run-Ct8taisL.js → redocly-openapi-docs.min.respect-run-DgsYdmxw.js} +1 -1
  19. package/dist/{redocly-openapi-docs.min.standalone-BPCdJgtH.js → redocly-openapi-docs.min.standalone-D9becCWS.js} +708 -673
  20. package/dist/redocly-openapi-docs.min.tauri-path-Bv9A5DVf.js +1 -0
  21. package/dist/{redocly-openapi-docs.min.useAiChatQueries-t8oy8jik.js → redocly-openapi-docs.min.useAiChatQueries-Cb-1pa0w.js} +2 -2
  22. package/lib/telemetry/RedocTelemetry.js +1 -31
  23. package/package.json +5 -5
  24. package/dist/redocly-openapi-docs.min.FileWatcher-DDoyaS7A.js +0 -1
  25. package/dist/redocly-openapi-docs.min.tauri-path-CmqBCxGb.js +0 -1
  26. package/lib/components/ApiInfo/__tests__/ApiInfo.test.d.ts +0 -1
  27. package/lib/components/ApiInfo/__tests__/ApiInfo.test.js +0 -46
  28. package/lib/components/Callbacks/__tests__/Callbacks.test.d.ts +0 -1
  29. package/lib/components/Callbacks/__tests__/Callbacks.test.js +0 -46
  30. package/lib/components/Content/__tests__/useAutoScroll.test.d.ts +0 -1
  31. package/lib/components/Content/__tests__/useAutoScroll.test.js +0 -88
  32. package/lib/components/ContentItem/__tests__/useIsExpanded.test.d.ts +0 -1
  33. package/lib/components/ContentItem/__tests__/useIsExpanded.test.js +0 -123
  34. package/lib/components/ContentItems/__tests__/Items.test.d.ts +0 -1
  35. package/lib/components/ContentItems/__tests__/Items.test.js +0 -66
  36. package/lib/components/ContentItems/__tests__/VirtualList.test.d.ts +0 -1
  37. package/lib/components/ContentItems/__tests__/VirtualList.test.js +0 -135
  38. package/lib/components/Discriminator/__tests__/DiscriminatorDropdown.test.d.ts +0 -1
  39. package/lib/components/Discriminator/__tests__/DiscriminatorDropdown.test.js +0 -63
  40. package/lib/components/Download/__tests__/DownloadSpecification.test.d.ts +0 -1
  41. package/lib/components/Download/__tests__/DownloadSpecification.test.js +0 -52
  42. package/lib/components/ExpandAllButton/__tests__/ExpandAllButton.test.d.ts +0 -1
  43. package/lib/components/ExpandAllButton/__tests__/ExpandAllButton.test.js +0 -60
  44. package/lib/components/ExpandAllButton/__tests__/helpers.test.d.ts +0 -1
  45. package/lib/components/ExpandAllButton/__tests__/helpers.test.js +0 -133
  46. package/lib/components/Language/__tests__/LanguageDropdown.test.d.ts +0 -1
  47. package/lib/components/Language/__tests__/LanguageDropdown.test.js +0 -23
  48. package/lib/components/Markdown/__tests__/Markdown.test.d.ts +0 -1
  49. package/lib/components/Markdown/__tests__/Markdown.test.js +0 -34
  50. package/lib/components/McpOverview/__tests__/McpOverview.test.d.ts +0 -1
  51. package/lib/components/McpOverview/__tests__/McpOverview.test.js +0 -66
  52. package/lib/components/McpTool/__tests__/McpPrompt.test.d.ts +0 -1
  53. package/lib/components/McpTool/__tests__/McpPrompt.test.js +0 -57
  54. package/lib/components/McpTool/__tests__/McpResource.test.d.ts +0 -1
  55. package/lib/components/McpTool/__tests__/McpResource.test.js +0 -81
  56. package/lib/components/McpTool/__tests__/McpTool.test.d.ts +0 -1
  57. package/lib/components/McpTool/__tests__/McpTool.test.js +0 -82
  58. package/lib/components/MediaTypeSwitch/__tests__/MediaTypesSwitch.test.d.ts +0 -1
  59. package/lib/components/MediaTypeSwitch/__tests__/MediaTypesSwitch.test.js +0 -79
  60. package/lib/components/OperationItem/__tests__/OperationItem.test.d.ts +0 -1
  61. package/lib/components/OperationItem/__tests__/OperationItem.test.js +0 -70
  62. package/lib/components/OperationItem/__tests__/__mocks__/mock-intersection-observer.d.ts +0 -16
  63. package/lib/components/OperationItem/__tests__/__mocks__/mock-intersection-observer.js +0 -42
  64. package/lib/components/Overview/__tests__/Overview.test.d.ts +0 -1
  65. package/lib/components/Overview/__tests__/Overview.test.js +0 -59
  66. package/lib/components/PayloadSamples/__tests__/Example.test.d.ts +0 -1
  67. package/lib/components/PayloadSamples/__tests__/Example.test.js +0 -36
  68. package/lib/components/PayloadSamples/__tests__/ExampleValue.test.d.ts +0 -1
  69. package/lib/components/PayloadSamples/__tests__/ExampleValue.test.js +0 -197
  70. package/lib/components/PayloadSamples/__tests__/PayloadSamples.test.d.ts +0 -1
  71. package/lib/components/PayloadSamples/__tests__/PayloadSamples.test.js +0 -38
  72. package/lib/components/PropertyDetails/__tests__/Extensions.test.d.ts +0 -1
  73. package/lib/components/PropertyDetails/__tests__/Extensions.test.js +0 -21
  74. package/lib/components/PropertyDetails/__tests__/FieldDetail.test.d.ts +0 -1
  75. package/lib/components/PropertyDetails/__tests__/FieldDetail.test.js +0 -52
  76. package/lib/components/PropertyDetails/__tests__/FieldDetails.test.d.ts +0 -1
  77. package/lib/components/PropertyDetails/__tests__/FieldDetails.test.js +0 -191
  78. package/lib/components/PropertyDetails/__tests__/PropertyDetails.test.d.ts +0 -1
  79. package/lib/components/PropertyDetails/__tests__/PropertyDetails.test.js +0 -365
  80. package/lib/components/PropertyDetails/__tests__/cycleColorsByLevel.test.d.ts +0 -1
  81. package/lib/components/PropertyDetails/__tests__/cycleColorsByLevel.test.js +0 -23
  82. package/lib/components/RedoclyOpenAPIDocs/__tests__/AppProvider.test.d.ts +0 -1
  83. package/lib/components/RedoclyOpenAPIDocs/__tests__/AppProvider.test.js +0 -16
  84. package/lib/components/RedoclyOpenAPIDocs/__tests__/RedoclyOpenAPIDocs.test.d.ts +0 -1
  85. package/lib/components/RedoclyOpenAPIDocs/__tests__/RedoclyOpenAPIDocs.test.js +0 -104
  86. package/lib/components/RenderHook/__tests__/RenderHook.test.d.ts +0 -1
  87. package/lib/components/RenderHook/__tests__/RenderHook.test.js +0 -15
  88. package/lib/components/Replay/__tests__/utils.test.d.ts +0 -1
  89. package/lib/components/Replay/__tests__/utils.test.js +0 -526
  90. package/lib/components/Request/__tests__/RequestDetails.test.d.ts +0 -1
  91. package/lib/components/Request/__tests__/RequestDetails.test.js +0 -98
  92. package/lib/components/RequestSamples/__tests__/Example.test.d.ts +0 -1
  93. package/lib/components/RequestSamples/__tests__/Example.test.js +0 -384
  94. package/lib/components/RequestSamples/__tests__/RequestSamples.test.d.ts +0 -1
  95. package/lib/components/RequestSamples/__tests__/RequestSamples.test.js +0 -226
  96. package/lib/components/RequestSamples/__tests__/useCodeSamples.test.d.ts +0 -1
  97. package/lib/components/RequestSamples/__tests__/useCodeSamples.test.js +0 -64
  98. package/lib/components/ResponseSamples/__tests__/ResponseSamples.test.d.ts +0 -1
  99. package/lib/components/ResponseSamples/__tests__/ResponseSamples.test.js +0 -29
  100. package/lib/components/Responses/__tests__/OperationResponseList.test.d.ts +0 -1
  101. package/lib/components/Responses/__tests__/OperationResponseList.test.js +0 -89
  102. package/lib/components/Responses/__tests__/ResponseDetails.test.d.ts +0 -1
  103. package/lib/components/Responses/__tests__/ResponseDetails.test.js +0 -111
  104. package/lib/components/Responses/__tests__/ResponsesHeaders.test.d.ts +0 -1
  105. package/lib/components/Responses/__tests__/ResponsesHeaders.test.js +0 -26
  106. package/lib/components/Schema/__tests__/ArraySchema.test.d.ts +0 -1
  107. package/lib/components/Schema/__tests__/ArraySchema.test.js +0 -93
  108. package/lib/components/Schema/__tests__/ObjectSchema.test.d.ts +0 -1
  109. package/lib/components/Schema/__tests__/ObjectSchema.test.js +0 -115
  110. package/lib/components/Schema/__tests__/OneOfSchema.test.d.ts +0 -1
  111. package/lib/components/Schema/__tests__/OneOfSchema.test.js +0 -33
  112. package/lib/components/Schema/__tests__/Schema.test.d.ts +0 -1
  113. package/lib/components/Schema/__tests__/Schema.test.js +0 -67
  114. package/lib/components/Schema/__tests__/useOneOfLocationIdx.test.d.ts +0 -1
  115. package/lib/components/Schema/__tests__/useOneOfLocationIdx.test.js +0 -22
  116. package/lib/components/SchemaCatalogLink/__tests__/SchemaCatalogLink.test.d.ts +0 -1
  117. package/lib/components/SchemaCatalogLink/__tests__/SchemaCatalogLink.test.js +0 -95
  118. package/lib/components/Security/__tests__/Security.test.d.ts +0 -1
  119. package/lib/components/Security/__tests__/Security.test.js +0 -38
  120. package/lib/components/Security/__tests__/SecurityButton.test.d.ts +0 -1
  121. package/lib/components/Security/__tests__/SecurityButton.test.js +0 -92
  122. package/lib/components/Security/__tests__/SecurityModal.test.d.ts +0 -1
  123. package/lib/components/Security/__tests__/SecurityModal.test.js +0 -172
  124. package/lib/components/ServerList/__tests__/ServerList.test.d.ts +0 -1
  125. package/lib/components/ServerList/__tests__/ServerList.test.js +0 -83
  126. package/lib/components/Tabs/__tests__/Tabs.test.d.ts +0 -1
  127. package/lib/components/Tabs/__tests__/Tabs.test.js +0 -27
  128. package/lib/components/ViewNested/__tests__/ViewNested.test.d.ts +0 -1
  129. package/lib/components/ViewNested/__tests__/ViewNested.test.js +0 -42
  130. package/lib/components/__tests__/Samples/ExampleSwitch.test.d.ts +0 -1
  131. package/lib/components/__tests__/Samples/ExampleSwitch.test.js +0 -45
  132. package/lib/components/__tests__/Samples/use-example-key.test.d.ts +0 -1
  133. package/lib/components/__tests__/Samples/use-example-key.test.js +0 -28
  134. package/lib/components/__tests__/common/ClearButton.test.d.ts +0 -1
  135. package/lib/components/__tests__/common/ClearButton.test.js +0 -18
  136. package/lib/components/__tests__/common/Dropdown.test.d.ts +0 -1
  137. package/lib/components/__tests__/common/Dropdown.test.js +0 -52
  138. package/lib/components/__tests__/mocks/examples.d.ts +0 -4
  139. package/lib/components/__tests__/mocks/examples.js +0 -115
  140. package/lib/components/common/__tests__/Dropdown.test.d.ts +0 -1
  141. package/lib/components/common/__tests__/Dropdown.test.js +0 -129
  142. package/lib/components/common/__tests__/LinkToField.test.d.ts +0 -1
  143. package/lib/components/common/__tests__/LinkToField.test.js +0 -39
  144. package/lib/jotai/__tests__/app.test.d.ts +0 -1
  145. package/lib/jotai/__tests__/app.test.js +0 -53
  146. package/lib/models/__tests__/Callback.test.d.ts +0 -1
  147. package/lib/models/__tests__/Callback.test.js +0 -15
  148. package/lib/models/__tests__/FieldModel.test.d.ts +0 -1
  149. package/lib/models/__tests__/FieldModel.test.js +0 -117
  150. package/lib/models/__tests__/MediaContent.test.d.ts +0 -1
  151. package/lib/models/__tests__/MediaContent.test.js +0 -105
  152. package/lib/models/__tests__/Operation.test.d.ts +0 -1
  153. package/lib/models/__tests__/Operation.test.js +0 -459
  154. package/lib/models/__tests__/Response.test.d.ts +0 -1
  155. package/lib/models/__tests__/Response.test.js +0 -221
  156. package/lib/models/__tests__/Schema.circular.test.d.ts +0 -1
  157. package/lib/models/__tests__/Schema.circular.test.js +0 -694
  158. package/lib/models/__tests__/Schema.test.d.ts +0 -1
  159. package/lib/models/__tests__/Schema.test.js +0 -1395
  160. package/lib/models/__tests__/example.test.d.ts +0 -1
  161. package/lib/models/__tests__/example.test.js +0 -90
  162. package/lib/models/__tests__/group.test.d.ts +0 -1
  163. package/lib/models/__tests__/group.test.js +0 -52
  164. package/lib/models/__tests__/helpers.d.ts +0 -5
  165. package/lib/models/__tests__/helpers.js +0 -62
  166. package/lib/models/__tests__/request.test.d.ts +0 -1
  167. package/lib/models/__tests__/request.test.js +0 -119
  168. package/lib/services/__tests__/OpenAPIParser.test.d.ts +0 -1
  169. package/lib/services/__tests__/OpenAPIParser.test.js +0 -80
  170. package/lib/services/__tests__/check.test.d.ts +0 -1
  171. package/lib/services/__tests__/check.test.js +0 -22
  172. package/lib/services/__tests__/utils.test.d.ts +0 -1
  173. package/lib/services/__tests__/utils.test.js +0 -42
  174. package/lib/services/code-samples/__tests__/apply-environments.test.d.ts +0 -1
  175. package/lib/services/code-samples/__tests__/apply-environments.test.js +0 -64
  176. package/lib/services/code-samples/__tests__/build-code-samples.test.d.ts +0 -1
  177. package/lib/services/code-samples/__tests__/build-code-samples.test.js +0 -70
  178. package/lib/services/code-samples/__tests__/convertSampleToString.test.d.ts +0 -1
  179. package/lib/services/code-samples/__tests__/convertSampleToString.test.js +0 -116
  180. package/lib/services/code-samples/__tests__/generator-data-value.test.d.ts +0 -1
  181. package/lib/services/code-samples/__tests__/generator-data-value.test.js +0 -277
  182. package/lib/services/code-samples/__tests__/generator-serialized-value.test.d.ts +0 -1
  183. package/lib/services/code-samples/__tests__/generator-serialized-value.test.js +0 -258
  184. package/lib/services/code-samples/__tests__/generator-value.test.d.ts +0 -1
  185. package/lib/services/code-samples/__tests__/generator-value.test.js +0 -273
  186. package/lib/services/code-samples/__tests__/generator.test.d.ts +0 -249
  187. package/lib/services/code-samples/__tests__/generator.test.js +0 -1201
  188. package/lib/services/code-samples/__tests__/get-example-value-by-mime-type.test.d.ts +0 -1
  189. package/lib/services/code-samples/__tests__/get-example-value-by-mime-type.test.js +0 -31
  190. package/lib/services/code-samples/httpsnippet/__tests__/device-authorization.test.d.ts +0 -1
  191. package/lib/services/code-samples/httpsnippet/__tests__/device-authorization.test.js +0 -222
  192. package/lib/services/code-samples/httpsnippet/helpers/__tests__/code-helpers.test.d.ts +0 -1
  193. package/lib/services/code-samples/httpsnippet/helpers/__tests__/code-helpers.test.js +0 -129
  194. package/lib/services/code-samples/httpsnippet/helpers/__tests__/string-utility.test.d.ts +0 -1
  195. package/lib/services/code-samples/httpsnippet/helpers/__tests__/string-utility.test.js +0 -49
  196. package/lib/services/code-samples/httpsnippet/targets/csharp/__tests__/httpclient.test.d.ts +0 -1
  197. package/lib/services/code-samples/httpsnippet/targets/csharp/__tests__/httpclient.test.js +0 -172
  198. package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/__tests__/httpclient.test.d.ts +0 -1
  199. package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/__tests__/httpclient.test.js +0 -172
  200. package/lib/services/code-samples/httpsnippet/targets/go/__tests__/native.test.d.ts +0 -1
  201. package/lib/services/code-samples/httpsnippet/targets/go/__tests__/native.test.js +0 -130
  202. package/lib/services/code-samples/httpsnippet/targets/java/__tests__/httpclient.test.d.ts +0 -1
  203. package/lib/services/code-samples/httpsnippet/targets/java/__tests__/httpclient.test.js +0 -191
  204. package/lib/services/code-samples/httpsnippet/targets/java8/__tests__/apachehttp.test.d.ts +0 -1
  205. package/lib/services/code-samples/httpsnippet/targets/java8/__tests__/apachehttp.test.js +0 -172
  206. package/lib/services/code-samples/httpsnippet/targets/javascript/__tests__/fetch.test.d.ts +0 -1
  207. package/lib/services/code-samples/httpsnippet/targets/javascript/__tests__/fetch.test.js +0 -85
  208. package/lib/services/code-samples/httpsnippet/targets/node/__tests__/fetch.test.d.ts +0 -1
  209. package/lib/services/code-samples/httpsnippet/targets/node/__tests__/fetch.test.js +0 -85
  210. package/lib/services/code-samples/httpsnippet/targets/php/__tests__/curl.test.d.ts +0 -1
  211. package/lib/services/code-samples/httpsnippet/targets/php/__tests__/curl.test.js +0 -126
  212. package/lib/services/code-samples/httpsnippet/targets/python/__tests__/requests.test.d.ts +0 -1
  213. package/lib/services/code-samples/httpsnippet/targets/python/__tests__/requests.test.js +0 -105
  214. package/lib/services/code-samples/httpsnippet/targets/r/__tests__/httr.test.d.ts +0 -1
  215. package/lib/services/code-samples/httpsnippet/targets/r/__tests__/httr.test.js +0 -126
  216. package/lib/services/code-samples/httpsnippet/targets/ruby/__tests__/native.test.d.ts +0 -1
  217. package/lib/services/code-samples/httpsnippet/targets/ruby/__tests__/native.test.js +0 -129
  218. package/lib/services/code-samples/httpsnippet/targets/shell/__tests__/curl.test.d.ts +0 -1
  219. package/lib/services/code-samples/httpsnippet/targets/shell/__tests__/curl.test.js +0 -129
  220. package/lib/services/config-options/__tests__/helpers.test.d.ts +0 -1
  221. package/lib/services/config-options/__tests__/helpers.test.js +0 -234
  222. package/lib/services/history/__tests__/helpers.test.d.ts +0 -1
  223. package/lib/services/history/__tests__/helpers.test.js +0 -19
  224. package/lib/services/menu/__tests__/buildNestedTagsItems.test.d.ts +0 -1
  225. package/lib/services/menu/__tests__/buildNestedTagsItems.test.js +0 -109
  226. package/lib/services/menu/__tests__/builder.test.d.ts +0 -1
  227. package/lib/services/menu/__tests__/builder.test.js +0 -307
  228. package/lib/services/menu/__tests__/operation.test.d.ts +0 -1
  229. package/lib/services/menu/__tests__/operation.test.js +0 -240
  230. package/lib/services/menu/__tests__/tags.test.d.ts +0 -1
  231. package/lib/services/menu/__tests__/tags.test.js +0 -71
  232. package/lib/telemetry/__tests__/RedocTelemetry.test.d.ts +0 -1
  233. package/lib/telemetry/__tests__/RedocTelemetry.test.js +0 -107
  234. package/lib/testProviders.d.ts +0 -6
  235. package/lib/testProviders.js +0 -14
  236. package/lib/utils/__tests__/areArraysEqual.test.d.ts +0 -1
  237. package/lib/utils/__tests__/areArraysEqual.test.js +0 -33
  238. package/lib/utils/__tests__/argValuesHelpers.d.ts +0 -1
  239. package/lib/utils/__tests__/argValuesHelpers.js +0 -56
  240. package/lib/utils/__tests__/calculateMaxLength.test.d.ts +0 -1
  241. package/lib/utils/__tests__/calculateMaxLength.test.js +0 -119
  242. package/lib/utils/__tests__/configure-helpers.test.d.ts +0 -1
  243. package/lib/utils/__tests__/configure-helpers.test.js +0 -356
  244. package/lib/utils/__tests__/convertSwagger2OpenAPI.test.d.ts +0 -1
  245. package/lib/utils/__tests__/convertSwagger2OpenAPI.test.js +0 -392
  246. package/lib/utils/__tests__/debounce.test.d.ts +0 -1
  247. package/lib/utils/__tests__/debounce.test.js +0 -54
  248. package/lib/utils/__tests__/debug.test.d.ts +0 -1
  249. package/lib/utils/__tests__/debug.test.js +0 -23
  250. package/lib/utils/__tests__/dom.test.d.ts +0 -1
  251. package/lib/utils/__tests__/dom.test.js +0 -108
  252. package/lib/utils/__tests__/getBreadcrumbs.test.d.ts +0 -1
  253. package/lib/utils/__tests__/getBreadcrumbs.test.js +0 -98
  254. package/lib/utils/__tests__/hasNestedFields.test.d.ts +0 -1
  255. package/lib/utils/__tests__/hasNestedFields.test.js +0 -147
  256. package/lib/utils/__tests__/helpers.test.d.ts +0 -1
  257. package/lib/utils/__tests__/helpers.test.js +0 -174
  258. package/lib/utils/__tests__/isMobile.test.d.ts +0 -1
  259. package/lib/utils/__tests__/isMobile.test.js +0 -28
  260. package/lib/utils/__tests__/loadAndBundleSpec.test.d.ts +0 -1
  261. package/lib/utils/__tests__/loadAndBundleSpec.test.js +0 -22
  262. package/lib/utils/__tests__/local-storage.test.d.ts +0 -1
  263. package/lib/utils/__tests__/local-storage.test.js +0 -48
  264. package/lib/utils/__tests__/object.test.d.ts +0 -1
  265. package/lib/utils/__tests__/object.test.js +0 -45
  266. package/lib/utils/__tests__/openapi.test.d.ts +0 -1
  267. package/lib/utils/__tests__/openapi.test.js +0 -1378
  268. package/lib/utils/__tests__/path.test.d.ts +0 -1
  269. package/lib/utils/__tests__/path.test.js +0 -16
  270. package/lib/utils/__tests__/queryString.test.d.ts +0 -1
  271. package/lib/utils/__tests__/queryString.test.js +0 -60
  272. package/lib/utils/__tests__/replaceVariables.test.d.ts +0 -1
  273. package/lib/utils/__tests__/replaceVariables.test.js +0 -46
  274. package/lib/utils/__tests__/simplifyAstStructure.test.d.ts +0 -1
  275. package/lib/utils/__tests__/simplifyAstStructure.test.js +0 -26
  276. package/lib/utils/__tests__/sort.test.d.ts +0 -1
  277. package/lib/utils/__tests__/sort.test.js +0 -16
  278. package/lib/utils/__tests__/string.test.d.ts +0 -1
  279. package/lib/utils/__tests__/string.test.js +0 -16
  280. package/lib/utils/__tests__/theme-helpers.test.d.ts +0 -1
  281. package/lib/utils/__tests__/theme-helpers.test.js +0 -24
  282. package/lib/utils/__tests__/url.test.d.ts +0 -1
  283. package/lib/utils/__tests__/url.test.js +0 -134
@@ -1,29 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { render } from '@testing-library/react';
3
- import { ResponseSamples } from '../ResponseSamples.js';
4
- import { normalizeOptions, OpenAPIParser } from '../../../services/index.js';
5
- import { getOperation } from '../../../models/index.js';
6
- import { withTestProviders } from '../../../testProviders.js';
7
- import museum from './fixtures/museum.json';
8
- import definitionWithContent from './fixtures/operationDefinitionWithContent.json';
9
- import definitionWithoutContent from './fixtures/operationDefinitionWithoutContent.json';
10
- describe('ResponseSamples', () => {
11
- let operation;
12
- const options = normalizeOptions({});
13
- const parser = new OpenAPIParser(museum, undefined, options);
14
- it('renders PayloadSamples when response has a sample', () => {
15
- operation = getOperation(parser, definitionWithContent, undefined, options, '');
16
- const { container } = render(withTestProviders(_jsx(ResponseSamples, { operation: operation, activeResponseTab: "200", onTabChange: vi.fn() }), {
17
- definition: parser.definition,
18
- }));
19
- expect(container).toHaveTextContent('2023-09-11');
20
- });
21
- it('renders StyledCodeBlock when response does not have a sample', () => {
22
- operation = getOperation(parser, definitionWithoutContent, undefined, options, '');
23
- const { container } = render(withTestProviders(_jsx(ResponseSamples, { operation: operation, activeResponseTab: "200", onTabChange: vi.fn() }), {
24
- definition: parser.definition,
25
- }));
26
- expect(container).toHaveTextContent('No content');
27
- });
28
- });
29
- //# sourceMappingURL=ResponseSamples.test.js.map
@@ -1,89 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { render, screen, fireEvent } from '@testing-library/react';
3
- import { OperationResponseList } from '../OperationResponseList.js';
4
- import { getMediaContent } from '../../../models/index.js';
5
- import { normalizeOptions, OpenAPIParser } from '../../../services/index.js';
6
- import { withTestProviders, TestMemoryRouter } from '../../../testProviders.js';
7
- const OPERATION_POINTER = '#/paths/~1pets/get';
8
- // Wide enough that the second expansion level (45 * 45 = 2025 rows) blows the
9
- // 2000-row budget, so computeExpandAllDepth returns 1 for this schema.
10
- const WIDTH = 45;
11
- function makeWideProperties(prefix, value) {
12
- return Object.fromEntries(Array.from({ length: WIDTH }, (_, i) => [`${prefix}_${i}`, { ...value }]));
13
- }
14
- const definition = {
15
- openapi: '3.0.0',
16
- info: { title: 'test', version: '0' },
17
- paths: {},
18
- components: {
19
- schemas: {
20
- Small: {
21
- type: 'object',
22
- properties: {
23
- nested: {
24
- type: 'object',
25
- properties: { leaf: { type: 'string' } },
26
- },
27
- },
28
- },
29
- Big: {
30
- type: 'object',
31
- properties: makeWideProperties('big', { $ref: '#/components/schemas/BigLeaf' }),
32
- },
33
- BigLeaf: {
34
- type: 'object',
35
- properties: makeWideProperties('leaf', { type: 'string' }),
36
- },
37
- },
38
- },
39
- };
40
- // The probe replaces the heavy ResponseDetails tree: it renders a real SubSchema
41
- // (like the schema tree does) so the test observes the depth actually applied to
42
- // nested nodes after the active response tab changes.
43
- vi.mock('../ResponseDetails.js', async () => {
44
- const { SubSchema } = await import('../../Schema/SubSchema.js');
45
- return {
46
- ResponseDetails: () => (_jsx(SubSchema, { expandByDefault: false, expandable: true, level: 2, propertyLength: WIDTH, deepLink: `${OPERATION_POINTER}/t=response`, operationPointer: OPERATION_POINTER, children: _jsx("div", { "data-testid": "nested-content" }) })),
47
- };
48
- });
49
- const options = normalizeOptions({});
50
- const parser = new OpenAPIParser(definition, undefined, options);
51
- function makeResponse(code, schemaRef) {
52
- return {
53
- code,
54
- expanded: false,
55
- type: 'GET',
56
- summary: '',
57
- description: '',
58
- headers: [],
59
- toggle: vi.fn(),
60
- expand: vi.fn(),
61
- content: getMediaContent({
62
- parser,
63
- info: { 'application/json': { schema: { $ref: schemaRef } } },
64
- isRequestType: false,
65
- options,
66
- data: { operation: { pointer: OPERATION_POINTER } },
67
- }),
68
- };
69
- }
70
- describe('OperationResponseList expand-all depth', () => {
71
- it('recomputes the expand-all depth when the active response tab changes', () => {
72
- const responses = [
73
- makeResponse('200', '#/components/schemas/Small'),
74
- makeResponse('500', '#/components/schemas/Big'),
75
- ];
76
- render(withTestProviders(_jsx(TestMemoryRouter, { children: _jsx(OperationResponseList, { responses: responses, operationId: "getPets", operationPointer: OPERATION_POINTER, callbackId: "" }) }), { definition }));
77
- // Expand all while the small 200 schema is active: its depth is the ceiling,
78
- // so the level-2 probe node expands.
79
- fireEvent.click(screen.getByRole('button', { name: /expand all/i }));
80
- expect(screen.getByTestId('nested-content')).toBeInTheDocument();
81
- // Switch to the 500 tab with the DAG-shaped schema. The budgeted depth for it
82
- // is 1, so the level-2 node must NOT auto-expand even though expandedAll is
83
- // still on — otherwise the stale depth reintroduces the page freeze.
84
- fireEvent.click(screen.getByText('500'));
85
- expect(screen.getByRole('button', { name: /collapse all/i })).toBeInTheDocument();
86
- expect(screen.queryByTestId('nested-content')).not.toBeInTheDocument();
87
- });
88
- });
89
- //# sourceMappingURL=OperationResponseList.test.js.map
@@ -1,111 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { render } from '@testing-library/react';
3
- import * as Jotai from 'jotai';
4
- import { ResponseDetails } from '../ResponseDetails.js';
5
- import { normalizeOptions, OpenAPIParser } from '../../../services/index.js';
6
- import { getField, getMediaContent } from '../../../models/index.js';
7
- import { globalOptionsAtom, globalStoreAtom } from '../../../jotai/store.js';
8
- import { activeMimeNameAtom } from '../../../jotai/app.js';
9
- import { TestMemoryRouter } from '../../../testProviders.js';
10
- const info = {
11
- 'application/json': {
12
- schema: {
13
- additionalProperties: {
14
- format: 'int32',
15
- },
16
- },
17
- examples: {
18
- bee: {
19
- mime: 'application/json',
20
- value: {
21
- category: {
22
- id: 0,
23
- name: 'string',
24
- },
25
- honeyPerDay: 3.14,
26
- id: 0,
27
- petType: 'bee',
28
- status: 'available',
29
- },
30
- },
31
- cat: {
32
- mime: 'application/json',
33
- value: {
34
- category: {
35
- id: 0,
36
- name: 'string',
37
- },
38
- huntingSkill: 'adventurous',
39
- id: 0,
40
- petType: 'cat',
41
- status: 'available',
42
- },
43
- },
44
- },
45
- },
46
- 'application/xml': {
47
- schema: {
48
- additionalProperties: {
49
- format: 'int32',
50
- },
51
- },
52
- },
53
- };
54
- const options = normalizeOptions({});
55
- const parser = new OpenAPIParser({ openapi: '3.0', info: { title: 'test', version: '0' }, paths: {} }, undefined, options);
56
- const response = {
57
- expanded: false,
58
- code: '200',
59
- summary: `summary`,
60
- description: `***\n**su*mm*ary**\n[link](/link)`,
61
- type: 'GET',
62
- headers: [
63
- getField(parser, {
64
- name: 'test',
65
- in: 'path',
66
- content: {
67
- 'application/json': {
68
- schema: {
69
- $ref: '#/components/testProperties/readOnlyInContent',
70
- },
71
- },
72
- },
73
- }, '', options, { operation: {} }),
74
- ],
75
- toggle: vi.fn(),
76
- expand: vi.fn(),
77
- content: getMediaContent({
78
- parser,
79
- info,
80
- isRequestType: true,
81
- options,
82
- data: { operation: {} },
83
- }),
84
- };
85
- vi.mock('jotai', async () => ({
86
- ...(await vi.importActual('jotai')),
87
- useAtomValue: vi.fn(),
88
- }));
89
- describe('ResponseDetails component', () => {
90
- vi.spyOn(Jotai, 'useAtomValue').mockImplementation((atom) => {
91
- if (atom === globalOptionsAtom) {
92
- return options;
93
- }
94
- if (atom === globalStoreAtom)
95
- return { options, parser };
96
- if (atom === activeMimeNameAtom)
97
- return ['application/json', vi.fn()];
98
- return {};
99
- });
100
- it('should renders correctly', () => {
101
- const { container } = render(_jsx(TestMemoryRouter, { children: _jsx(ResponseDetails, { response: response, operationId: " " }) }));
102
- expect(container.childNodes.length).toEqual(5);
103
- });
104
- it('should render description as markdown', () => {
105
- const expectedTags = ['p'];
106
- const { container } = render(_jsx(TestMemoryRouter, { children: _jsx(ResponseDetails, { response: { ...response, headers: [] }, operationId: "" }) }));
107
- const markdownContainer = container.querySelector('.redoc-markdown');
108
- expect(markdownContainer?.querySelectorAll(expectedTags.join(','))).toHaveLength(expectedTags.length);
109
- });
110
- });
111
- //# sourceMappingURL=ResponseDetails.test.js.map
@@ -1,26 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { render } from '@testing-library/react';
3
- import { ResponseHeaders } from '../ResponseHeaders.js';
4
- import { PropertiesTable } from '../../common/index.js';
5
- vi.mock('../../common', () => ({
6
- PropertiesTable: vi.fn(() => _jsx("div", { "data-testid": "properties-table" })),
7
- }));
8
- vi.mock('../../PropertyDetails', () => ({
9
- Field: vi.fn(() => _jsx("div", { "data-testid": "property-details" })),
10
- }));
11
- describe('ResponseHeaders', () => {
12
- afterEach(() => {
13
- vi.clearAllMocks();
14
- });
15
- test('renders nothing if headers are not defined', () => {
16
- const { container } = render(_jsx(ResponseHeaders, { headers: undefined }));
17
- expect(container.firstChild).toBeNull();
18
- expect(PropertiesTable).not.toHaveBeenCalled();
19
- });
20
- test('renders nothing if headers array is empty', () => {
21
- const { container } = render(_jsx(ResponseHeaders, { headers: [] }));
22
- expect(container.firstChild).toBeNull();
23
- expect(PropertiesTable).not.toHaveBeenCalled();
24
- });
25
- });
26
- //# sourceMappingURL=ResponsesHeaders.test.js.map
@@ -1 +0,0 @@
1
- export {};
@@ -1,93 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { render } from '@testing-library/react';
3
- import * as Jotai from 'jotai';
4
- import { normalizeOptions, OpenAPIParser } from '../../../services/index.js';
5
- import { getSchema } from '../../../models/index.js';
6
- import schemasExpansionLevel from './fixtures/schemaExpansionLevel.json';
7
- import { Schema } from '../Schema.js';
8
- import { TestBrowserRouter } from '../../../testProviders.js';
9
- const options = normalizeOptions({});
10
- vi.mock('jotai', async () => ({
11
- ...(await vi.importActual('jotai')),
12
- useAtomValue: vi.fn(),
13
- }));
14
- describe('ArraySchema', () => {
15
- it("should render Schema with Array when schemasExpansionLevel is 'all'", async () => {
16
- vi.spyOn(Jotai, 'useAtomValue').mockReturnValue(normalizeOptions({ schemasExpansionLevel: 'all' }));
17
- const parser = new OpenAPIParser(schemasExpansionLevel, undefined, options);
18
- const schema = getSchema({
19
- parser,
20
- schemaOrRef: schemasExpansionLevel.components.schemas.User,
21
- pointer: '',
22
- options,
23
- deps: {
24
- operation: {
25
- pointer: 'schemasExpansionLevel',
26
- },
27
- },
28
- });
29
- const { getByText } = render(_jsx(Schema, { schema: schema }), {
30
- wrapper: TestBrowserRouter,
31
- });
32
- expect(getByText('Dumb Property 3')).toBeInTheDocument();
33
- });
34
- it("should render Schema with Array when schemasExpansionLevel is '3'", async () => {
35
- vi.spyOn(Jotai, 'useAtomValue').mockReturnValue(normalizeOptions({ schemasExpansionLevel: '3' }));
36
- const parser = new OpenAPIParser(schemasExpansionLevel, undefined, options);
37
- const schema = getSchema({
38
- parser,
39
- schemaOrRef: schemasExpansionLevel.components.schemas.User,
40
- pointer: '',
41
- options,
42
- deps: {
43
- operation: {
44
- pointer: 'schemasExpansionLevel',
45
- },
46
- },
47
- });
48
- const { getByText, queryByText } = render(_jsx(Schema, { schema: schema }), {
49
- wrapper: TestBrowserRouter,
50
- });
51
- expect(getByText('Dumb Property 1')).toBeInTheDocument();
52
- expect(queryByText('Dumb Property 2')).toBeInTheDocument();
53
- });
54
- it('should automatically expand nested array when parent element is expanded', async () => {
55
- vi.spyOn(Jotai, 'useAtomValue').mockReturnValue(normalizeOptions({ schemasExpansionLevel: '4' }));
56
- const parser = new OpenAPIParser(schemasExpansionLevel, undefined, options);
57
- const schema = getSchema({
58
- parser,
59
- schemaOrRef: schemasExpansionLevel.components.schemas.User,
60
- pointer: '',
61
- options,
62
- deps: {
63
- operation: {
64
- pointer: 'schemasExpansionLevel',
65
- },
66
- },
67
- });
68
- const { getByText } = render(_jsx(Schema, { schema: schema }), {
69
- wrapper: TestBrowserRouter,
70
- });
71
- expect(getByText('Dumb Property 1 in nested array')).toBeInTheDocument();
72
- });
73
- it("should not render inner Schema with Array when schemasExpansionLevel is '0'", async () => {
74
- vi.spyOn(Jotai, 'useAtomValue').mockReturnValue(normalizeOptions({ schemasExpansionLevel: '0' }));
75
- const parser = new OpenAPIParser(schemasExpansionLevel, undefined, options);
76
- const schema = getSchema({
77
- parser,
78
- schemaOrRef: schemasExpansionLevel.components.schemas.User,
79
- pointer: '',
80
- options,
81
- deps: {
82
- operation: {
83
- pointer: 'schemasExpansionLevel',
84
- },
85
- },
86
- });
87
- const { queryByText } = render(_jsx(Schema, { schema: schema }), {
88
- wrapper: TestBrowserRouter,
89
- });
90
- expect(queryByText('Dumb Property')).toBeNull();
91
- });
92
- });
93
- //# sourceMappingURL=ArraySchema.test.js.map
@@ -1,115 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { render } from '@testing-library/react';
3
- import * as Jotai from 'jotai';
4
- import { normalizeOptions, OpenAPIParser } from '../../../services/index.js';
5
- import { getSchema } from '../../../models/index.js';
6
- import schemasExpansionLevel from './fixtures/schemaExpansionLevel.json';
7
- import requiredField from './fixtures/requiredField.json';
8
- import { Schema } from '../Schema.js';
9
- import { TestBrowserRouter } from '../../../testProviders.js';
10
- const options = normalizeOptions({});
11
- vi.mock('jotai', async () => ({
12
- ...(await vi.importActual('jotai')),
13
- useAtomValue: vi.fn(),
14
- }));
15
- describe('ObjectSchema', () => {
16
- it("should render Schema when schemasExpansionLevel is 'all'", async () => {
17
- vi.spyOn(Jotai, 'useAtomValue').mockReturnValue(normalizeOptions({ schemasExpansionLevel: 'all' }));
18
- const parser = new OpenAPIParser(schemasExpansionLevel, undefined, options);
19
- const schema = getSchema({
20
- parser,
21
- schemaOrRef: schemasExpansionLevel.components.schemas.Pet,
22
- pointer: '',
23
- options,
24
- deps: {
25
- operation: {
26
- pointer: 'schemasExpansionLevel',
27
- },
28
- },
29
- });
30
- const { getByText } = render(_jsx(Schema, { schema: schema }), {
31
- wrapper: TestBrowserRouter,
32
- });
33
- expect(getByText('Dumb Property 6')).toBeInTheDocument();
34
- });
35
- it("should render Schema when schemasExpansionLevel is '3'", async () => {
36
- vi.spyOn(Jotai, 'useAtomValue').mockReturnValue(normalizeOptions({ schemasExpansionLevel: '3' }));
37
- const parser = new OpenAPIParser(schemasExpansionLevel, undefined, options);
38
- const schema = getSchema({
39
- parser,
40
- schemaOrRef: schemasExpansionLevel.components.schemas.Pet,
41
- pointer: '',
42
- options,
43
- deps: {
44
- operation: {
45
- pointer: 'schemasExpansionLevel',
46
- },
47
- },
48
- });
49
- const { getByText, queryByText } = render(_jsx(Schema, { schema: schema }), {
50
- wrapper: TestBrowserRouter,
51
- });
52
- expect(getByText('Dumb Property 3')).toBeInTheDocument();
53
- expect(queryByText('Dumb Property 4')).toBeNull();
54
- });
55
- it("should not render inner Schema when schemasExpansionLevel is '0'", async () => {
56
- vi.spyOn(Jotai, 'useAtomValue').mockReturnValue(normalizeOptions({ schemasExpansionLevel: '0' }));
57
- const parser = new OpenAPIParser(schemasExpansionLevel, undefined, options);
58
- const schema = getSchema({
59
- parser,
60
- schemaOrRef: schemasExpansionLevel.components.schemas.Pet,
61
- pointer: '',
62
- options,
63
- deps: {
64
- operation: {
65
- pointer: 'schemasExpansionLevel',
66
- },
67
- },
68
- });
69
- const { queryByText } = render(_jsx(Schema, { schema: schema }), {
70
- wrapper: TestBrowserRouter,
71
- });
72
- expect(queryByText('Test Sub Category')).toBeNull();
73
- });
74
- it("should render Schema when required is 'category' -> 'sub'", async () => {
75
- vi.spyOn(Jotai, 'useAtomValue').mockReturnValue(normalizeOptions({}));
76
- const parser = new OpenAPIParser(requiredField, undefined, options);
77
- const schema = getSchema({
78
- parser,
79
- schemaOrRef: requiredField.components.schemas.Pet,
80
- pointer: '',
81
- options,
82
- deps: {
83
- operation: {
84
- pointer: 'schemasExpansionLevel',
85
- },
86
- },
87
- });
88
- const { getByText, queryByText } = render(_jsx(Schema, { schema: schema }), {
89
- wrapper: TestBrowserRouter,
90
- });
91
- expect(getByText('Dumb Property 2')).toBeInTheDocument();
92
- expect(queryByText('Dumb Property 3')).toBeNull();
93
- });
94
- it("should render Schema when required is 'tags' -> 'sub' at Array schema", async () => {
95
- vi.spyOn(Jotai, 'useAtomValue').mockReturnValue(normalizeOptions({}));
96
- const parser = new OpenAPIParser(requiredField, undefined, options);
97
- const schema = getSchema({
98
- parser,
99
- schemaOrRef: requiredField.components.schemas.User,
100
- pointer: '',
101
- options,
102
- deps: {
103
- operation: {
104
- pointer: 'schemasExpansionLevel',
105
- },
106
- },
107
- });
108
- const { getByText, queryByText } = render(_jsx(Schema, { schema: schema }), {
109
- wrapper: TestBrowserRouter,
110
- });
111
- expect(getByText('Dumb Property 1')).toBeInTheDocument();
112
- expect(queryByText('Dumb Property 2')).toBeNull();
113
- });
114
- });
115
- //# sourceMappingURL=ObjectSchema.test.js.map
@@ -1 +0,0 @@
1
- export {};
@@ -1,33 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { render } from '@testing-library/react';
3
- import { normalizeOptions, OpenAPIParser } from '../../../services/index.js';
4
- import { getSchema } from '../../../models/index.js';
5
- import oneOfWithDiscriminator from './fixtures/oneOfWithDiscriminator.json';
6
- import { Schema } from '../Schema.js';
7
- import { TestBrowserRouter } from '../../../testProviders.js';
8
- const options = normalizeOptions({});
9
- describe('OneOfSchema', () => {
10
- it('should render correct oneOf and discriminator based on deep link', () => {
11
- const parser = new OpenAPIParser(oneOfWithDiscriminator, undefined, options);
12
- const schema = getSchema({
13
- parser,
14
- schemaOrRef: { $ref: '#/components/schemas/OneOfSchema' },
15
- pointer: '',
16
- options,
17
- deps: {
18
- operation: {
19
- pointer: '/paths/schema',
20
- },
21
- },
22
- absolutePointer: '/paths/schema',
23
- });
24
- history.pushState({}, '', 'user/createuser#user/createuser/t=request&path=pet&oneof=1&d=1&oneof=0');
25
- const { getByText } = render(_jsx(Schema, { schema: schema }), {
26
- wrapper: TestBrowserRouter,
27
- });
28
- expect(getByText('Type of the shape - Shape')).toBeInTheDocument();
29
- expect(getByText('Whether or not the triangle is equilateral')).toBeInTheDocument();
30
- expect(getByText('Perimeter of the Equilateral')).toBeInTheDocument();
31
- });
32
- });
33
- //# sourceMappingURL=OneOfSchema.test.js.map
@@ -1 +0,0 @@
1
- export {};
@@ -1,67 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { act, fireEvent, render } from '@testing-library/react';
3
- import { normalizeOptions, OpenAPIParser } from '../../../services/index.js';
4
- import { getSchema } from '../../../models/index.js';
5
- import oneOfWithDiscriminator from './fixtures/oneOfWithDiscriminator.json';
6
- import singleOneOf from './fixtures/singleOneOf.json';
7
- import { Schema } from '../Schema.js';
8
- import { TestBrowserRouter } from '../../../testProviders.js';
9
- const options = normalizeOptions({});
10
- describe('SchemaView', () => {
11
- describe('OneOf', () => {
12
- it('should render oneOf with a single item and display its schema fields', () => {
13
- const parser = new OpenAPIParser(singleOneOf, undefined, options);
14
- const schema = getSchema({
15
- parser,
16
- schemaOrRef: singleOneOf.paths['/example'].get.responses['200'].content['application/json'].schema,
17
- pointer: '',
18
- options,
19
- deps: {
20
- operation: {
21
- pointer: '/paths/example',
22
- },
23
- },
24
- absolutePointer: '/paths/example',
25
- });
26
- const { getByText } = render(_jsx(Schema, { schema: schema }), {
27
- wrapper: TestBrowserRouter,
28
- });
29
- expect(getByText('One of:')).toBeInTheDocument();
30
- expect(getByText('UserResponse')).toBeInTheDocument();
31
- expect(getByText('type')).toBeInTheDocument();
32
- expect(getByText('data')).toBeInTheDocument();
33
- });
34
- it('should render oneOf with a discriminator without affecting each other', () => {
35
- const parser = new OpenAPIParser(oneOfWithDiscriminator, undefined, options);
36
- const schema = getSchema({
37
- parser,
38
- schemaOrRef: { $ref: '#/components/schemas/OneOfSchema' },
39
- pointer: '',
40
- options,
41
- deps: {
42
- operation: {
43
- pointer: '/paths/schema',
44
- },
45
- },
46
- absolutePointer: '/paths/schema',
47
- });
48
- const { getByText } = render(_jsx(Schema, { schema: schema }), {
49
- wrapper: TestBrowserRouter,
50
- });
51
- expect(getByText('Shape')).toBeInTheDocument();
52
- act(() => {
53
- fireEvent.click(getByText('Shape'));
54
- });
55
- expect(getByText('Discriminator')).toBeInTheDocument();
56
- expect(getByText('square')).toBeInTheDocument();
57
- expect(getByText('triangle')).toBeInTheDocument();
58
- expect(getByText('sideLength')).toBeInTheDocument();
59
- act(() => {
60
- fireEvent.click(getByText('triangle'));
61
- });
62
- expect(getByText('equilateral')).toBeInTheDocument();
63
- expect(getByText('Whether or not the triangle is equilateral')).toBeInTheDocument();
64
- });
65
- });
66
- });
67
- //# sourceMappingURL=Schema.test.js.map
@@ -1,22 +0,0 @@
1
- import { renderHook } from '@testing-library/react';
2
- import { useOneOfLocationIdx } from '../useOneOfLocationIdx.js';
3
- vi.mock('react-router', () => ({
4
- useLocation: vi.fn().mockReturnValue({
5
- hash: '#plans/postplan/t=request&path=&oneof=1/trial&oneof=0/period',
6
- }),
7
- }));
8
- describe('useOneOfLocationIdx', () => {
9
- it('should return the index of the oneOf item in the hash', () => {
10
- const oneOf = [{}, {}, {}];
11
- const level = 1;
12
- const { result } = renderHook(() => useOneOfLocationIdx(oneOf, level));
13
- expect(result.current).toBe(1);
14
- });
15
- it('should return -1 if the oneOf item is not found in the hash', () => {
16
- const oneOf = [{}, {}, {}];
17
- const level = 3;
18
- const { result } = renderHook(() => useOneOfLocationIdx(oneOf, level));
19
- expect(result.current).toBe(-1);
20
- });
21
- });
22
- //# sourceMappingURL=useOneOfLocationIdx.test.js.map