@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,36 +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 { Example } from '../Example.js';
5
- import { normalizeOptions, OpenAPIParser } from '../../../services/index.js';
6
- import { getExamples } from '../../../models/index.js';
7
- import testDefinition from './fixtures/mediaTypeUrlencoded.json';
8
- describe('Example component', () => {
9
- const opts = normalizeOptions({});
10
- const parser = new OpenAPIParser(testDefinition, undefined, opts);
11
- it('render component without error when `externalValue` is pdf file', () => {
12
- const example = getExamples({
13
- parser,
14
- infoOrRef: {
15
- summary: 'A sample file',
16
- externalValue: 'https://assets.identi.tech/dummy.pdf',
17
- },
18
- mime: 'application/pdf',
19
- });
20
- const { container } = render(_jsx(Jotai.Provider, { children: _jsx(Example, { example: example, mimeType: example.mime, onCopyClick: vi.fn() }) }));
21
- expect(container).toMatchSnapshot();
22
- });
23
- it('render component with `externalValue`', () => {
24
- const example = getExamples({
25
- parser,
26
- infoOrRef: {
27
- summary: 'A sample json',
28
- externalValue: 'https://jsonplaceholder.typicode.com/todos/1',
29
- },
30
- mime: 'application/json',
31
- });
32
- const { container } = render(_jsx(Jotai.Provider, { children: _jsx(Example, { example: example, mimeType: example.mime, onCopyClick: vi.fn() }) }));
33
- expect(container).toMatchSnapshot();
34
- });
35
- });
36
- //# sourceMappingURL=Example.test.js.map
@@ -1,197 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { render } from '@testing-library/react';
3
- import { vi } from 'vitest';
4
- import * as Jotai from 'jotai';
5
- import { ExampleValue } from '../ExampleValue.js';
6
- import { globalOptionsAtom } from '../../../jotai/store.js';
7
- import { normalizeOptions } from '../../../services/index.js';
8
- vi.mock('@redocly/theme/components/JsonViewer/JsonViewer', () => ({
9
- JsonViewer: vi.fn(({ data, expandLevel, onCopyClick, onPanelToggle }) => (_jsxs("div", { "data-testid": "json-viewer", "data-expand-level": expandLevel, children: [_jsx("pre", { "data-testid": "json-viewer-data", children: JSON.stringify(data, null, 2) }), onCopyClick && _jsx("button", { "data-testid": "copy-button", onClick: onCopyClick }), onPanelToggle && _jsx("button", { "data-testid": "panel-toggle", onClick: () => onPanelToggle(true) })] }))),
10
- }));
11
- vi.mock('../styled.js', () => ({
12
- StyledCodeBlock: vi.fn(({ source, lang, header }) => (_jsxs("div", { "data-testid": "code-block", "data-lang": lang, children: [_jsx("pre", { children: source }), header?.controls?.copy && (_jsx("button", { "data-testid": "code-block-copy", onClick: header.controls.copy.onClick }))] }))),
13
- }));
14
- vi.mock('jotai', async () => {
15
- const actual = await vi.importActual('jotai');
16
- return {
17
- ...actual,
18
- useAtomValue: vi.fn(),
19
- };
20
- });
21
- describe('ExampleValue', () => {
22
- const mockUseAtomValue = Jotai.useAtomValue;
23
- const options = normalizeOptions({});
24
- beforeEach(async () => {
25
- vi.clearAllMocks();
26
- const actualJotai = await vi.importActual('jotai');
27
- mockUseAtomValue.mockImplementation((atom) => {
28
- if (atom === globalOptionsAtom) {
29
- return {
30
- ...options,
31
- jsonSamplesExpandLevel: 2,
32
- };
33
- }
34
- return actualJotai.useAtomValue(atom);
35
- });
36
- });
37
- describe('JSON parsing for application/json', () => {
38
- it('should parse valid JSON string and pass parsed object to JsonViewer', () => {
39
- const validJsonString = '{"name":"Test User","value":"premium","count":5}';
40
- const props = {
41
- value: validJsonString,
42
- mimeType: 'application/json',
43
- onCopyClick: vi.fn(),
44
- };
45
- const { getByTestId } = render(_jsx(Jotai.Provider, { children: _jsx(ExampleValue, { ...props }) }));
46
- const jsonData = getByTestId('json-viewer-data');
47
- const parsedData = JSON.parse(jsonData.textContent || '{}');
48
- expect(parsedData).toEqual({
49
- name: 'Test User',
50
- value: 'premium',
51
- count: 5,
52
- });
53
- });
54
- it('should use value as-is when it is already an object (not a string)', () => {
55
- const objectValue = { name: 'Test User', value: 'premium', count: 5 };
56
- const props = {
57
- value: objectValue,
58
- mimeType: 'application/json',
59
- onCopyClick: vi.fn(),
60
- };
61
- const { getByTestId } = render(_jsx(Jotai.Provider, { children: _jsx(ExampleValue, { ...props }) }));
62
- const jsonData = getByTestId('json-viewer-data');
63
- const parsedData = JSON.parse(jsonData.textContent || '{}');
64
- expect(parsedData).toEqual(objectValue);
65
- });
66
- it('should fallback to original value when JSON string is invalid', () => {
67
- const invalidJsonString = '{"name":"Test User",invalid json}';
68
- const props = {
69
- value: invalidJsonString,
70
- mimeType: 'application/json',
71
- onCopyClick: vi.fn(),
72
- };
73
- const { getByTestId } = render(_jsx(Jotai.Provider, { children: _jsx(ExampleValue, { ...props }) }));
74
- const jsonData = getByTestId('json-viewer-data');
75
- const parsedData = JSON.parse(jsonData.textContent || '');
76
- expect(parsedData).toBe(invalidJsonString);
77
- });
78
- });
79
- describe('XML handling for application/xml', () => {
80
- it('should wrap object in root tag and convert to XML (dataValue case)', () => {
81
- const objectValue = { name: 'Test User', value: 'premium' };
82
- const props = {
83
- value: objectValue,
84
- mimeType: 'application/xml',
85
- onCopyClick: vi.fn(),
86
- };
87
- const { getByTestId } = render(_jsx(Jotai.Provider, { children: _jsx(ExampleValue, { ...props }) }));
88
- const codeBlock = getByTestId('code-block');
89
- const source = codeBlock.querySelector('pre')?.textContent || '';
90
- expect(source).toContain('<root>');
91
- expect(source).toContain('<name>Test User</name>');
92
- expect(source).toContain('<value>premium</value>');
93
- expect(source).toContain('</root>');
94
- });
95
- it('should not wrap array in root tag for XML', () => {
96
- const arrayValue = [{ item: 'one' }, { item: 'two' }];
97
- const props = {
98
- value: arrayValue,
99
- mimeType: 'application/xml',
100
- onCopyClick: vi.fn(),
101
- };
102
- const { getByTestId } = render(_jsx(Jotai.Provider, { children: _jsx(ExampleValue, { ...props }) }));
103
- const codeBlock = getByTestId('code-block');
104
- const source = codeBlock.querySelector('pre')?.textContent || '';
105
- expect(source).not.toContain('<root>');
106
- expect(source).toContain('<item>one</item>');
107
- expect(source).toContain('<item>two</item>');
108
- });
109
- it('should render pre-built XML string from sampler with attributes (nodeType: attribute)', () => {
110
- const xmlString = '<Artifact catalogId="ART-2024-001">\n <title>Mona Lisa</title>\n</Artifact>';
111
- const props = {
112
- value: xmlString,
113
- mimeType: 'application/xml',
114
- onCopyClick: vi.fn(),
115
- };
116
- const { getByTestId } = render(_jsx(Jotai.Provider, { children: _jsx(ExampleValue, { ...props }) }));
117
- const codeBlock = getByTestId('code-block');
118
- const source = codeBlock.querySelector('pre')?.textContent || '';
119
- expect(source).toContain('catalogId="ART-2024-001"');
120
- expect(source).toContain('<title>Mona Lisa</title>');
121
- });
122
- it('should render pre-built XML string with text nodes (nodeType: text)', () => {
123
- const xmlString = '<Artifact>\n <title>Mona Lisa</title>\nPortrait painting by Leonardo da Vinci</Artifact>';
124
- const props = {
125
- value: xmlString,
126
- mimeType: 'application/xml',
127
- onCopyClick: vi.fn(),
128
- };
129
- const { getByTestId } = render(_jsx(Jotai.Provider, { children: _jsx(ExampleValue, { ...props }) }));
130
- const codeBlock = getByTestId('code-block');
131
- const source = codeBlock.querySelector('pre')?.textContent || '';
132
- expect(source).toContain('Portrait painting by Leonardo da Vinci');
133
- expect(source).toContain('<title>Mona Lisa</title>');
134
- });
135
- it('should render pre-built XML string with CDATA (nodeType: cdata)', () => {
136
- const xmlString = '<Documentation>\n <![CDATA[<html><head><title>Docs</title></head></html>]]>\n</Documentation>';
137
- const props = {
138
- value: xmlString,
139
- mimeType: 'application/xml',
140
- onCopyClick: vi.fn(),
141
- };
142
- const { getByTestId } = render(_jsx(Jotai.Provider, { children: _jsx(ExampleValue, { ...props }) }));
143
- const codeBlock = getByTestId('code-block');
144
- const source = codeBlock.querySelector('pre')?.textContent || '';
145
- expect(source).toContain('<![CDATA[');
146
- expect(source).toContain('<html><head><title>Docs</title></head></html>');
147
- expect(source).toContain(']]>');
148
- });
149
- it('should render pre-built XML string with all nodeTypes combined (sampler output)', () => {
150
- const xmlString = [
151
- '<Artifact catalogId="ART-2024-001" era="Renaissance">',
152
- ' <title>Mona Lisa</title>',
153
- 'Portrait painting by Leonardo da Vinci',
154
- ' <![CDATA[<note>Handle with <b>extreme</b> care</note>]]>',
155
- ' <artists>',
156
- ' <Artist role="painter">',
157
- ' <name>Leonardo da Vinci</name>',
158
- ' </Artist>',
159
- ' </artists>',
160
- '</Artifact>',
161
- ].join('\n');
162
- const props = {
163
- value: xmlString,
164
- mimeType: 'application/xml',
165
- onCopyClick: vi.fn(),
166
- };
167
- const { getByTestId } = render(_jsx(Jotai.Provider, { children: _jsx(ExampleValue, { ...props }) }));
168
- const codeBlock = getByTestId('code-block');
169
- const source = codeBlock.querySelector('pre')?.textContent || '';
170
- expect(source).toContain('catalogId="ART-2024-001"');
171
- expect(source).toContain('era="Renaissance"');
172
- expect(source).toContain('<title>Mona Lisa</title>');
173
- expect(source).toContain('Portrait painting by Leonardo da Vinci');
174
- expect(source).toContain('<![CDATA[<note>Handle with <b>extreme</b> care</note>]]>');
175
- expect(source).not.toContain('internalCode');
176
- expect(source).not.toContain('INT-7742-X');
177
- });
178
- it('should convert JS object to XML with CDATA support via xmlBuilder', () => {
179
- const objectValue = {
180
- Documentation: {
181
- '#cdata': '<html><head><title>Docs</title></head></html>',
182
- },
183
- };
184
- const props = {
185
- value: objectValue,
186
- mimeType: 'application/xml',
187
- onCopyClick: vi.fn(),
188
- };
189
- const { getByTestId } = render(_jsx(Jotai.Provider, { children: _jsx(ExampleValue, { ...props }) }));
190
- const codeBlock = getByTestId('code-block');
191
- const source = codeBlock.querySelector('pre')?.textContent || '';
192
- expect(source).toContain('<![CDATA[');
193
- expect(source).toContain(']]>');
194
- });
195
- });
196
- });
197
- //# sourceMappingURL=ExampleValue.test.js.map
@@ -1,38 +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 { getMediaContent, getOperation } from '../../../models/index.js';
5
- import { withTestProviders } from '../../../testProviders.js';
6
- import { PayloadSamples } from '../PayloadSamples.js';
7
- import testDefinition from './fixtures/mediaTypeUrlencoded.json';
8
- describe('PayloadSamples', () => {
9
- let operation;
10
- const options = normalizeOptions({});
11
- const parser = new OpenAPIParser(testDefinition, undefined, options);
12
- test('should renders correctly without example to application/x-www-form-urlencoded', async () => {
13
- operation = getOperation(parser, {
14
- pointer: '#/paths/~1test/get',
15
- pathName: '/test',
16
- httpVerb: 'GET',
17
- pathParameters: [],
18
- pathServers: [],
19
- isWebhook: false,
20
- isAdditionalOperation: false,
21
- ...testDefinition.paths['/test'].get,
22
- }, undefined, options, 'tests');
23
- const props = {
24
- operation,
25
- content: getMediaContent({
26
- parser,
27
- info: testDefinition.paths['/test'].get.requestBody.content,
28
- isRequestType: true,
29
- options,
30
- data: { operation },
31
- }),
32
- onCopyClick: vi.fn(),
33
- };
34
- const { container } = render(withTestProviders(_jsx(PayloadSamples, { ...props }), { definition: parser.definition }));
35
- expect(container).toHaveTextContent(/name=string&status=string/);
36
- });
37
- });
38
- //# sourceMappingURL=PayloadSamples.test.js.map
@@ -1,21 +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 { Extensions } from '../Extensions.js';
5
- import { normalizeOptions } from '../../../services/index.js';
6
- vi.mock('jotai', async () => ({
7
- ...(await vi.importActual('jotai')),
8
- useAtomValue: vi.fn(),
9
- }));
10
- describe('Components', () => {
11
- describe('Extensions', () => {
12
- it('Extensions label renders correctly', () => {
13
- vi.spyOn(Jotai, 'useAtomValue').mockReturnValue(normalizeOptions({
14
- showExtensions: true,
15
- }));
16
- const { container } = render(_jsx(Extensions, { extensions: { 'x-test': 'Add new pet to the store inventory' } }));
17
- expect(container).toHaveTextContent(/test: Add new pet to the store inventory/);
18
- });
19
- });
20
- });
21
- //# sourceMappingURL=Extensions.test.js.map
@@ -1,52 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { render } from '@testing-library/react';
3
- import { FieldDetail } from '../FieldDetail.js';
4
- describe('FieldDetail', () => {
5
- const wrapper = (label, value) => render(_jsx(FieldDetail, { label: label, value: value }));
6
- it('should render with DefaultValue component', () => {
7
- const { getByText } = wrapper('Default', 'value');
8
- expect(getByText('"value"')).toBeInTheDocument();
9
- expect(getByText('Default')).toBeInTheDocument();
10
- });
11
- it('should render with ExampleValue component', () => {
12
- const { getByText } = wrapper('Example:', 'value');
13
- expect(getByText('"value"')).toBeInTheDocument();
14
- expect(getByText('Example:')).toBeInTheDocument();
15
- });
16
- it('should render FieldValueLabel in all other cases', () => {
17
- const { getByText } = wrapper('Deprecated', 'value');
18
- expect(getByText('"value"')).toBeInTheDocument();
19
- expect(getByText('Deprecated')).toBeInTheDocument();
20
- });
21
- describe('example type with structured values', () => {
22
- const objectValue = {
23
- name: 'John Alfred Smith',
24
- street: '123 Main Street',
25
- city: 'San Francisco',
26
- };
27
- it('should render object example pretty-printed with JSON highlighting', () => {
28
- const { getByTestId, getByText } = render(_jsx(FieldDetail, { label: "Example:", value: objectValue, type: "example" }));
29
- expect(getByText('Example:')).toBeInTheDocument();
30
- const viewer = getByTestId('json-viewer');
31
- // pretty-printed: keys and values are separate tokens on multiple lines,
32
- // not a single-line JSON.stringify blob
33
- expect(viewer.textContent).toContain('"name"');
34
- expect(viewer.textContent).toContain('"John Alfred Smith"');
35
- expect(viewer.textContent).toContain('\n');
36
- // syntax highlighting: token spans styled by the code theme
37
- expect(viewer.querySelector('.token.string')).not.toBeNull();
38
- });
39
- it('should render array example pretty-printed with JSON highlighting', () => {
40
- const { getByTestId } = render(_jsx(FieldDetail, { label: "Example:", value: ['79f943e212cce7de21c054a8'], type: "example" }));
41
- const viewer = getByTestId('json-viewer');
42
- expect(viewer.textContent).toContain('"79f943e212cce7de21c054a8"');
43
- expect(viewer.querySelector('.token.string')).not.toBeNull();
44
- });
45
- it('should keep scalar example values inline without JSON viewer', () => {
46
- const { getByText, queryByTestId } = render(_jsx(FieldDetail, { label: "Example:", value: "HRIS-27", type: "example" }));
47
- expect(getByText('"HRIS-27"')).toBeInTheDocument();
48
- expect(queryByTestId('json-viewer')).toBeNull();
49
- });
50
- });
51
- });
52
- //# sourceMappingURL=FieldDetail.test.js.map
@@ -1,191 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { render, screen } from '@testing-library/react';
3
- import * as Jotai from 'jotai';
4
- import { normalizeOptions, OpenAPIParser } from '../../../services/index.js';
5
- import { FieldDetails } from '../FieldDetails.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('FieldDetails', () => {
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 with enum', async () => {
19
- options.showAccessMode = true;
20
- const field = getField(parser, {
21
- name: 'test',
22
- in: 'path',
23
- content: {
24
- 'application/json': {
25
- schema: {
26
- $ref: '#/components/testProperties/fieldWithEnum',
27
- },
28
- },
29
- },
30
- }, '', options, deps);
31
- render(_jsx(FieldDetails, { field: field }), { wrapper: TestBrowserRouter });
32
- expect(screen.getByText('Enum')).toBeInTheDocument();
33
- expect(screen.getByText('"foo"')).toBeInTheDocument();
34
- expect(screen.getByText('"bar"')).toBeInTheDocument();
35
- });
36
- it('should render FieldDetails with enum and x-enumDescriptions', async () => {
37
- const field = getField(parser, {
38
- name: 'test',
39
- in: 'path',
40
- content: {
41
- 'application/json': {
42
- schema: {
43
- $ref: '#/components/testProperties/fieldWithEnumDescription',
44
- },
45
- },
46
- },
47
- }, '', options, deps);
48
- render(_jsx(FieldDetails, { field: field }), { wrapper: TestBrowserRouter });
49
- expect(screen.getByText('Enum Value')).toBeInTheDocument();
50
- expect(screen.getByText('foo')).toBeInTheDocument();
51
- expect(screen.getByText('bar')).toBeInTheDocument();
52
- expect(screen.getByText('Description foo')).toBeInTheDocument();
53
- expect(screen.getByText('Description bar')).toBeInTheDocument();
54
- });
55
- it('should render FieldDetails with enum and x-enumDescription with hiding value', async () => {
56
- vi.spyOn(Jotai, 'useAtomValue').mockReturnValue(normalizeOptions({ maxDisplayedEnumValues: 1 }));
57
- const field = getField(parser, {
58
- name: 'test',
59
- in: 'path',
60
- content: {
61
- 'application/json': {
62
- schema: {
63
- $ref: '#/components/testProperties/fieldWithEnumDescription',
64
- },
65
- },
66
- },
67
- }, '', options, deps);
68
- render(_jsx(FieldDetails, { field: field }), { wrapper: TestBrowserRouter });
69
- expect(screen.getByText('Value')).toBeInTheDocument();
70
- expect(screen.getByText('foo')).toBeInTheDocument();
71
- expect(screen.getByText('Description foo')).toBeInTheDocument();
72
- expect(screen.getByText('+1 more')).toBeInTheDocument();
73
- });
74
- it('should not render duplicate descriptions for anyOf schemas', async () => {
75
- const field = getField(parser, {
76
- name: 'testAnyOf',
77
- content: {
78
- 'application/json': {
79
- schema: {
80
- $ref: '#/components/anyOfSchemaWithDescription',
81
- },
82
- },
83
- },
84
- }, '', options, deps);
85
- render(_jsx(FieldDetails, { field: field }), { wrapper: TestBrowserRouter });
86
- const descriptions = screen.queryAllByText('This is a test anyOf schema with description');
87
- expect(descriptions).toHaveLength(0);
88
- const plainTextDescriptions = screen.queryAllByText('A plain text value');
89
- expect(plainTextDescriptions).toHaveLength(0);
90
- const numberDescriptions = screen.queryAllByText('A number value');
91
- expect(numberDescriptions).toHaveLength(0);
92
- });
93
- it('should keep only array-level info on the array field row when items have their own documentation', () => {
94
- vi.spyOn(Jotai, 'useAtomValue').mockReturnValue(options);
95
- const field = getField(parser, {
96
- name: 'owners',
97
- required: true,
98
- schema: {
99
- type: 'array',
100
- minItems: 1,
101
- maxItems: 20,
102
- description: 'List of ACL groups.',
103
- items: {
104
- type: 'string',
105
- format: 'email',
106
- maxLength: 256,
107
- pattern: '^\\S+@\\S+$',
108
- description: 'ACL group formatted as an email.',
109
- },
110
- },
111
- }, '', options, deps);
112
- render(_jsx(FieldDetails, { field: field }), { wrapper: TestBrowserRouter });
113
- expect(screen.getByText('owners')).toBeInTheDocument();
114
- expect(screen.getByText('Array of strings')).toBeInTheDocument();
115
- expect(screen.getByText('[ 1 .. 20 ] items')).toBeInTheDocument();
116
- expect(screen.getByText('List of ACL groups.')).toBeInTheDocument();
117
- // the items info is rendered in the nested items row instead
118
- expect(screen.queryByText('(email)')).not.toBeInTheDocument();
119
- expect(screen.queryByText('<= 256 characters')).not.toBeInTheDocument();
120
- expect(screen.queryByText('^\\S+@\\S+$')).not.toBeInTheDocument();
121
- expect(screen.queryByText('ACL group formatted as an email.')).not.toBeInTheDocument();
122
- });
123
- it('should hoist format of trivial items on the array field row', () => {
124
- vi.spyOn(Jotai, 'useAtomValue').mockReturnValue(options);
125
- const field = getField(parser, {
126
- name: 'emails',
127
- schema: {
128
- type: 'array',
129
- items: {
130
- type: 'string',
131
- format: 'email',
132
- },
133
- },
134
- }, '', options, deps);
135
- render(_jsx(FieldDetails, { field: field }), { wrapper: TestBrowserRouter });
136
- expect(screen.getByText('Array of strings')).toBeInTheDocument();
137
- expect(screen.getByText('(email)')).toBeInTheDocument();
138
- });
139
- it('should render object property example pretty-printed with JSON highlighting', () => {
140
- vi.spyOn(Jotai, 'useAtomValue').mockReturnValue(options);
141
- const field = getField(parser, {
142
- name: 'postal_address',
143
- schema: {
144
- type: 'object',
145
- example: {
146
- name: 'John Alfred Smith',
147
- street: '123 Main Street',
148
- city: 'San Francisco',
149
- },
150
- },
151
- }, '', options, deps);
152
- render(_jsx(FieldDetails, { field: field }), { wrapper: TestBrowserRouter });
153
- expect(screen.getByText('Example:')).toBeInTheDocument();
154
- const viewer = screen.getByTestId('json-viewer');
155
- // pretty-printed on multiple lines instead of a single-line JSON.stringify blob
156
- expect(viewer.textContent).toContain('"John Alfred Smith"');
157
- expect(viewer.textContent).toContain('\n');
158
- expect(screen.queryByText(JSON.stringify(field.example))).not.toBeInTheDocument();
159
- // syntax highlighting via code theme token spans
160
- expect(viewer.querySelector('.token.string')).not.toBeNull();
161
- });
162
- it('should keep scalar property example inline without JSON viewer', () => {
163
- vi.spyOn(Jotai, 'useAtomValue').mockReturnValue(options);
164
- const field = getField(parser, {
165
- name: 'custom_id',
166
- schema: { type: 'string', example: 'HRIS-27' },
167
- }, '', options, deps);
168
- render(_jsx(FieldDetails, { field: field }), { wrapper: TestBrowserRouter });
169
- expect(screen.getByText('"HRIS-27"')).toBeInTheDocument();
170
- expect(screen.queryByTestId('json-viewer')).toBeNull();
171
- });
172
- it('should render x-badges with before position, no position, and after position', () => {
173
- const field = getField(parser, {
174
- name: 'experimentalFlag',
175
- in: 'query',
176
- required: false,
177
- schema: { type: 'boolean' },
178
- 'x-badges': [
179
- { name: 'Beta', position: 'before' },
180
- { name: 'Experimental default' },
181
- { name: 'Experimental', position: 'after' },
182
- ],
183
- }, '#/components/parameters/paramWithBadges', options, deps);
184
- render(_jsx(FieldDetails, { field: field }), { wrapper: TestBrowserRouter });
185
- expect(screen.getByText('Beta')).toBeInTheDocument();
186
- expect(screen.getByText('Experimental default')).toBeInTheDocument();
187
- expect(screen.getByText('Experimental')).toBeInTheDocument();
188
- expect(screen.getByText('experimentalFlag')).toBeInTheDocument();
189
- });
190
- });
191
- //# sourceMappingURL=FieldDetails.test.js.map