@redocly/openapi-docs 3.24.1 → 3.24.2

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 (260) hide show
  1. package/lib/telemetry/RedocTelemetry.js +1 -31
  2. package/package.json +4 -4
  3. package/lib/components/ApiInfo/__tests__/ApiInfo.test.d.ts +0 -1
  4. package/lib/components/ApiInfo/__tests__/ApiInfo.test.js +0 -46
  5. package/lib/components/Callbacks/__tests__/Callbacks.test.d.ts +0 -1
  6. package/lib/components/Callbacks/__tests__/Callbacks.test.js +0 -46
  7. package/lib/components/Content/__tests__/useAutoScroll.test.d.ts +0 -1
  8. package/lib/components/Content/__tests__/useAutoScroll.test.js +0 -88
  9. package/lib/components/ContentItem/__tests__/useIsExpanded.test.d.ts +0 -1
  10. package/lib/components/ContentItem/__tests__/useIsExpanded.test.js +0 -123
  11. package/lib/components/ContentItems/__tests__/Items.test.d.ts +0 -1
  12. package/lib/components/ContentItems/__tests__/Items.test.js +0 -66
  13. package/lib/components/ContentItems/__tests__/VirtualList.test.d.ts +0 -1
  14. package/lib/components/ContentItems/__tests__/VirtualList.test.js +0 -135
  15. package/lib/components/Discriminator/__tests__/DiscriminatorDropdown.test.d.ts +0 -1
  16. package/lib/components/Discriminator/__tests__/DiscriminatorDropdown.test.js +0 -63
  17. package/lib/components/Download/__tests__/DownloadSpecification.test.d.ts +0 -1
  18. package/lib/components/Download/__tests__/DownloadSpecification.test.js +0 -52
  19. package/lib/components/ExpandAllButton/__tests__/ExpandAllButton.test.d.ts +0 -1
  20. package/lib/components/ExpandAllButton/__tests__/ExpandAllButton.test.js +0 -60
  21. package/lib/components/ExpandAllButton/__tests__/helpers.test.d.ts +0 -1
  22. package/lib/components/ExpandAllButton/__tests__/helpers.test.js +0 -133
  23. package/lib/components/Language/__tests__/LanguageDropdown.test.d.ts +0 -1
  24. package/lib/components/Language/__tests__/LanguageDropdown.test.js +0 -23
  25. package/lib/components/Markdown/__tests__/Markdown.test.d.ts +0 -1
  26. package/lib/components/Markdown/__tests__/Markdown.test.js +0 -34
  27. package/lib/components/McpOverview/__tests__/McpOverview.test.d.ts +0 -1
  28. package/lib/components/McpOverview/__tests__/McpOverview.test.js +0 -66
  29. package/lib/components/McpTool/__tests__/McpPrompt.test.d.ts +0 -1
  30. package/lib/components/McpTool/__tests__/McpPrompt.test.js +0 -57
  31. package/lib/components/McpTool/__tests__/McpResource.test.d.ts +0 -1
  32. package/lib/components/McpTool/__tests__/McpResource.test.js +0 -81
  33. package/lib/components/McpTool/__tests__/McpTool.test.d.ts +0 -1
  34. package/lib/components/McpTool/__tests__/McpTool.test.js +0 -82
  35. package/lib/components/MediaTypeSwitch/__tests__/MediaTypesSwitch.test.d.ts +0 -1
  36. package/lib/components/MediaTypeSwitch/__tests__/MediaTypesSwitch.test.js +0 -79
  37. package/lib/components/OperationItem/__tests__/OperationItem.test.d.ts +0 -1
  38. package/lib/components/OperationItem/__tests__/OperationItem.test.js +0 -70
  39. package/lib/components/OperationItem/__tests__/__mocks__/mock-intersection-observer.d.ts +0 -16
  40. package/lib/components/OperationItem/__tests__/__mocks__/mock-intersection-observer.js +0 -42
  41. package/lib/components/Overview/__tests__/Overview.test.d.ts +0 -1
  42. package/lib/components/Overview/__tests__/Overview.test.js +0 -59
  43. package/lib/components/PayloadSamples/__tests__/Example.test.d.ts +0 -1
  44. package/lib/components/PayloadSamples/__tests__/Example.test.js +0 -36
  45. package/lib/components/PayloadSamples/__tests__/ExampleValue.test.d.ts +0 -1
  46. package/lib/components/PayloadSamples/__tests__/ExampleValue.test.js +0 -197
  47. package/lib/components/PayloadSamples/__tests__/PayloadSamples.test.d.ts +0 -1
  48. package/lib/components/PayloadSamples/__tests__/PayloadSamples.test.js +0 -38
  49. package/lib/components/PropertyDetails/__tests__/Extensions.test.d.ts +0 -1
  50. package/lib/components/PropertyDetails/__tests__/Extensions.test.js +0 -21
  51. package/lib/components/PropertyDetails/__tests__/FieldDetail.test.d.ts +0 -1
  52. package/lib/components/PropertyDetails/__tests__/FieldDetail.test.js +0 -52
  53. package/lib/components/PropertyDetails/__tests__/FieldDetails.test.d.ts +0 -1
  54. package/lib/components/PropertyDetails/__tests__/FieldDetails.test.js +0 -191
  55. package/lib/components/PropertyDetails/__tests__/PropertyDetails.test.d.ts +0 -1
  56. package/lib/components/PropertyDetails/__tests__/PropertyDetails.test.js +0 -365
  57. package/lib/components/PropertyDetails/__tests__/cycleColorsByLevel.test.d.ts +0 -1
  58. package/lib/components/PropertyDetails/__tests__/cycleColorsByLevel.test.js +0 -23
  59. package/lib/components/RedoclyOpenAPIDocs/__tests__/AppProvider.test.d.ts +0 -1
  60. package/lib/components/RedoclyOpenAPIDocs/__tests__/AppProvider.test.js +0 -16
  61. package/lib/components/RedoclyOpenAPIDocs/__tests__/RedoclyOpenAPIDocs.test.d.ts +0 -1
  62. package/lib/components/RedoclyOpenAPIDocs/__tests__/RedoclyOpenAPIDocs.test.js +0 -104
  63. package/lib/components/RenderHook/__tests__/RenderHook.test.d.ts +0 -1
  64. package/lib/components/RenderHook/__tests__/RenderHook.test.js +0 -15
  65. package/lib/components/Replay/__tests__/utils.test.d.ts +0 -1
  66. package/lib/components/Replay/__tests__/utils.test.js +0 -526
  67. package/lib/components/Request/__tests__/RequestDetails.test.d.ts +0 -1
  68. package/lib/components/Request/__tests__/RequestDetails.test.js +0 -98
  69. package/lib/components/RequestSamples/__tests__/Example.test.d.ts +0 -1
  70. package/lib/components/RequestSamples/__tests__/Example.test.js +0 -384
  71. package/lib/components/RequestSamples/__tests__/RequestSamples.test.d.ts +0 -1
  72. package/lib/components/RequestSamples/__tests__/RequestSamples.test.js +0 -226
  73. package/lib/components/RequestSamples/__tests__/useCodeSamples.test.d.ts +0 -1
  74. package/lib/components/RequestSamples/__tests__/useCodeSamples.test.js +0 -64
  75. package/lib/components/ResponseSamples/__tests__/ResponseSamples.test.d.ts +0 -1
  76. package/lib/components/ResponseSamples/__tests__/ResponseSamples.test.js +0 -29
  77. package/lib/components/Responses/__tests__/OperationResponseList.test.d.ts +0 -1
  78. package/lib/components/Responses/__tests__/OperationResponseList.test.js +0 -89
  79. package/lib/components/Responses/__tests__/ResponseDetails.test.d.ts +0 -1
  80. package/lib/components/Responses/__tests__/ResponseDetails.test.js +0 -111
  81. package/lib/components/Responses/__tests__/ResponsesHeaders.test.d.ts +0 -1
  82. package/lib/components/Responses/__tests__/ResponsesHeaders.test.js +0 -26
  83. package/lib/components/Schema/__tests__/ArraySchema.test.d.ts +0 -1
  84. package/lib/components/Schema/__tests__/ArraySchema.test.js +0 -93
  85. package/lib/components/Schema/__tests__/ObjectSchema.test.d.ts +0 -1
  86. package/lib/components/Schema/__tests__/ObjectSchema.test.js +0 -115
  87. package/lib/components/Schema/__tests__/OneOfSchema.test.d.ts +0 -1
  88. package/lib/components/Schema/__tests__/OneOfSchema.test.js +0 -33
  89. package/lib/components/Schema/__tests__/Schema.test.d.ts +0 -1
  90. package/lib/components/Schema/__tests__/Schema.test.js +0 -67
  91. package/lib/components/Schema/__tests__/useOneOfLocationIdx.test.d.ts +0 -1
  92. package/lib/components/Schema/__tests__/useOneOfLocationIdx.test.js +0 -22
  93. package/lib/components/SchemaCatalogLink/__tests__/SchemaCatalogLink.test.d.ts +0 -1
  94. package/lib/components/SchemaCatalogLink/__tests__/SchemaCatalogLink.test.js +0 -95
  95. package/lib/components/Security/__tests__/Security.test.d.ts +0 -1
  96. package/lib/components/Security/__tests__/Security.test.js +0 -38
  97. package/lib/components/Security/__tests__/SecurityButton.test.d.ts +0 -1
  98. package/lib/components/Security/__tests__/SecurityButton.test.js +0 -92
  99. package/lib/components/Security/__tests__/SecurityModal.test.d.ts +0 -1
  100. package/lib/components/Security/__tests__/SecurityModal.test.js +0 -172
  101. package/lib/components/ServerList/__tests__/ServerList.test.d.ts +0 -1
  102. package/lib/components/ServerList/__tests__/ServerList.test.js +0 -83
  103. package/lib/components/Tabs/__tests__/Tabs.test.d.ts +0 -1
  104. package/lib/components/Tabs/__tests__/Tabs.test.js +0 -27
  105. package/lib/components/ViewNested/__tests__/ViewNested.test.d.ts +0 -1
  106. package/lib/components/ViewNested/__tests__/ViewNested.test.js +0 -42
  107. package/lib/components/__tests__/Samples/ExampleSwitch.test.d.ts +0 -1
  108. package/lib/components/__tests__/Samples/ExampleSwitch.test.js +0 -45
  109. package/lib/components/__tests__/Samples/use-example-key.test.d.ts +0 -1
  110. package/lib/components/__tests__/Samples/use-example-key.test.js +0 -28
  111. package/lib/components/__tests__/common/ClearButton.test.d.ts +0 -1
  112. package/lib/components/__tests__/common/ClearButton.test.js +0 -18
  113. package/lib/components/__tests__/common/Dropdown.test.d.ts +0 -1
  114. package/lib/components/__tests__/common/Dropdown.test.js +0 -52
  115. package/lib/components/__tests__/mocks/examples.d.ts +0 -4
  116. package/lib/components/__tests__/mocks/examples.js +0 -115
  117. package/lib/components/common/__tests__/Dropdown.test.d.ts +0 -1
  118. package/lib/components/common/__tests__/Dropdown.test.js +0 -129
  119. package/lib/components/common/__tests__/LinkToField.test.d.ts +0 -1
  120. package/lib/components/common/__tests__/LinkToField.test.js +0 -39
  121. package/lib/jotai/__tests__/app.test.d.ts +0 -1
  122. package/lib/jotai/__tests__/app.test.js +0 -53
  123. package/lib/models/__tests__/Callback.test.d.ts +0 -1
  124. package/lib/models/__tests__/Callback.test.js +0 -15
  125. package/lib/models/__tests__/FieldModel.test.d.ts +0 -1
  126. package/lib/models/__tests__/FieldModel.test.js +0 -117
  127. package/lib/models/__tests__/MediaContent.test.d.ts +0 -1
  128. package/lib/models/__tests__/MediaContent.test.js +0 -105
  129. package/lib/models/__tests__/Operation.test.d.ts +0 -1
  130. package/lib/models/__tests__/Operation.test.js +0 -459
  131. package/lib/models/__tests__/Response.test.d.ts +0 -1
  132. package/lib/models/__tests__/Response.test.js +0 -221
  133. package/lib/models/__tests__/Schema.circular.test.d.ts +0 -1
  134. package/lib/models/__tests__/Schema.circular.test.js +0 -694
  135. package/lib/models/__tests__/Schema.test.d.ts +0 -1
  136. package/lib/models/__tests__/Schema.test.js +0 -1395
  137. package/lib/models/__tests__/example.test.d.ts +0 -1
  138. package/lib/models/__tests__/example.test.js +0 -90
  139. package/lib/models/__tests__/group.test.d.ts +0 -1
  140. package/lib/models/__tests__/group.test.js +0 -52
  141. package/lib/models/__tests__/helpers.d.ts +0 -5
  142. package/lib/models/__tests__/helpers.js +0 -62
  143. package/lib/models/__tests__/request.test.d.ts +0 -1
  144. package/lib/models/__tests__/request.test.js +0 -119
  145. package/lib/services/__tests__/OpenAPIParser.test.d.ts +0 -1
  146. package/lib/services/__tests__/OpenAPIParser.test.js +0 -80
  147. package/lib/services/__tests__/check.test.d.ts +0 -1
  148. package/lib/services/__tests__/check.test.js +0 -22
  149. package/lib/services/__tests__/utils.test.d.ts +0 -1
  150. package/lib/services/__tests__/utils.test.js +0 -42
  151. package/lib/services/code-samples/__tests__/apply-environments.test.d.ts +0 -1
  152. package/lib/services/code-samples/__tests__/apply-environments.test.js +0 -64
  153. package/lib/services/code-samples/__tests__/build-code-samples.test.d.ts +0 -1
  154. package/lib/services/code-samples/__tests__/build-code-samples.test.js +0 -70
  155. package/lib/services/code-samples/__tests__/convertSampleToString.test.d.ts +0 -1
  156. package/lib/services/code-samples/__tests__/convertSampleToString.test.js +0 -116
  157. package/lib/services/code-samples/__tests__/generator-data-value.test.d.ts +0 -1
  158. package/lib/services/code-samples/__tests__/generator-data-value.test.js +0 -277
  159. package/lib/services/code-samples/__tests__/generator-serialized-value.test.d.ts +0 -1
  160. package/lib/services/code-samples/__tests__/generator-serialized-value.test.js +0 -258
  161. package/lib/services/code-samples/__tests__/generator-value.test.d.ts +0 -1
  162. package/lib/services/code-samples/__tests__/generator-value.test.js +0 -273
  163. package/lib/services/code-samples/__tests__/generator.test.d.ts +0 -249
  164. package/lib/services/code-samples/__tests__/generator.test.js +0 -1201
  165. package/lib/services/code-samples/__tests__/get-example-value-by-mime-type.test.d.ts +0 -1
  166. package/lib/services/code-samples/__tests__/get-example-value-by-mime-type.test.js +0 -31
  167. package/lib/services/code-samples/httpsnippet/__tests__/device-authorization.test.d.ts +0 -1
  168. package/lib/services/code-samples/httpsnippet/__tests__/device-authorization.test.js +0 -222
  169. package/lib/services/code-samples/httpsnippet/helpers/__tests__/code-helpers.test.d.ts +0 -1
  170. package/lib/services/code-samples/httpsnippet/helpers/__tests__/code-helpers.test.js +0 -129
  171. package/lib/services/code-samples/httpsnippet/helpers/__tests__/string-utility.test.d.ts +0 -1
  172. package/lib/services/code-samples/httpsnippet/helpers/__tests__/string-utility.test.js +0 -49
  173. package/lib/services/code-samples/httpsnippet/targets/csharp/__tests__/httpclient.test.d.ts +0 -1
  174. package/lib/services/code-samples/httpsnippet/targets/csharp/__tests__/httpclient.test.js +0 -172
  175. package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/__tests__/httpclient.test.d.ts +0 -1
  176. package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/__tests__/httpclient.test.js +0 -172
  177. package/lib/services/code-samples/httpsnippet/targets/go/__tests__/native.test.d.ts +0 -1
  178. package/lib/services/code-samples/httpsnippet/targets/go/__tests__/native.test.js +0 -130
  179. package/lib/services/code-samples/httpsnippet/targets/java/__tests__/httpclient.test.d.ts +0 -1
  180. package/lib/services/code-samples/httpsnippet/targets/java/__tests__/httpclient.test.js +0 -191
  181. package/lib/services/code-samples/httpsnippet/targets/java8/__tests__/apachehttp.test.d.ts +0 -1
  182. package/lib/services/code-samples/httpsnippet/targets/java8/__tests__/apachehttp.test.js +0 -172
  183. package/lib/services/code-samples/httpsnippet/targets/javascript/__tests__/fetch.test.d.ts +0 -1
  184. package/lib/services/code-samples/httpsnippet/targets/javascript/__tests__/fetch.test.js +0 -85
  185. package/lib/services/code-samples/httpsnippet/targets/node/__tests__/fetch.test.d.ts +0 -1
  186. package/lib/services/code-samples/httpsnippet/targets/node/__tests__/fetch.test.js +0 -85
  187. package/lib/services/code-samples/httpsnippet/targets/php/__tests__/curl.test.d.ts +0 -1
  188. package/lib/services/code-samples/httpsnippet/targets/php/__tests__/curl.test.js +0 -126
  189. package/lib/services/code-samples/httpsnippet/targets/python/__tests__/requests.test.d.ts +0 -1
  190. package/lib/services/code-samples/httpsnippet/targets/python/__tests__/requests.test.js +0 -105
  191. package/lib/services/code-samples/httpsnippet/targets/r/__tests__/httr.test.d.ts +0 -1
  192. package/lib/services/code-samples/httpsnippet/targets/r/__tests__/httr.test.js +0 -126
  193. package/lib/services/code-samples/httpsnippet/targets/ruby/__tests__/native.test.d.ts +0 -1
  194. package/lib/services/code-samples/httpsnippet/targets/ruby/__tests__/native.test.js +0 -129
  195. package/lib/services/code-samples/httpsnippet/targets/shell/__tests__/curl.test.d.ts +0 -1
  196. package/lib/services/code-samples/httpsnippet/targets/shell/__tests__/curl.test.js +0 -129
  197. package/lib/services/config-options/__tests__/helpers.test.d.ts +0 -1
  198. package/lib/services/config-options/__tests__/helpers.test.js +0 -234
  199. package/lib/services/history/__tests__/helpers.test.d.ts +0 -1
  200. package/lib/services/history/__tests__/helpers.test.js +0 -19
  201. package/lib/services/menu/__tests__/buildNestedTagsItems.test.d.ts +0 -1
  202. package/lib/services/menu/__tests__/buildNestedTagsItems.test.js +0 -109
  203. package/lib/services/menu/__tests__/builder.test.d.ts +0 -1
  204. package/lib/services/menu/__tests__/builder.test.js +0 -307
  205. package/lib/services/menu/__tests__/operation.test.d.ts +0 -1
  206. package/lib/services/menu/__tests__/operation.test.js +0 -240
  207. package/lib/services/menu/__tests__/tags.test.d.ts +0 -1
  208. package/lib/services/menu/__tests__/tags.test.js +0 -71
  209. package/lib/telemetry/__tests__/RedocTelemetry.test.d.ts +0 -1
  210. package/lib/telemetry/__tests__/RedocTelemetry.test.js +0 -107
  211. package/lib/testProviders.d.ts +0 -6
  212. package/lib/testProviders.js +0 -14
  213. package/lib/utils/__tests__/areArraysEqual.test.d.ts +0 -1
  214. package/lib/utils/__tests__/areArraysEqual.test.js +0 -33
  215. package/lib/utils/__tests__/argValuesHelpers.d.ts +0 -1
  216. package/lib/utils/__tests__/argValuesHelpers.js +0 -56
  217. package/lib/utils/__tests__/calculateMaxLength.test.d.ts +0 -1
  218. package/lib/utils/__tests__/calculateMaxLength.test.js +0 -119
  219. package/lib/utils/__tests__/configure-helpers.test.d.ts +0 -1
  220. package/lib/utils/__tests__/configure-helpers.test.js +0 -356
  221. package/lib/utils/__tests__/convertSwagger2OpenAPI.test.d.ts +0 -1
  222. package/lib/utils/__tests__/convertSwagger2OpenAPI.test.js +0 -392
  223. package/lib/utils/__tests__/debounce.test.d.ts +0 -1
  224. package/lib/utils/__tests__/debounce.test.js +0 -54
  225. package/lib/utils/__tests__/debug.test.d.ts +0 -1
  226. package/lib/utils/__tests__/debug.test.js +0 -23
  227. package/lib/utils/__tests__/dom.test.d.ts +0 -1
  228. package/lib/utils/__tests__/dom.test.js +0 -108
  229. package/lib/utils/__tests__/getBreadcrumbs.test.d.ts +0 -1
  230. package/lib/utils/__tests__/getBreadcrumbs.test.js +0 -98
  231. package/lib/utils/__tests__/hasNestedFields.test.d.ts +0 -1
  232. package/lib/utils/__tests__/hasNestedFields.test.js +0 -147
  233. package/lib/utils/__tests__/helpers.test.d.ts +0 -1
  234. package/lib/utils/__tests__/helpers.test.js +0 -174
  235. package/lib/utils/__tests__/isMobile.test.d.ts +0 -1
  236. package/lib/utils/__tests__/isMobile.test.js +0 -28
  237. package/lib/utils/__tests__/loadAndBundleSpec.test.d.ts +0 -1
  238. package/lib/utils/__tests__/loadAndBundleSpec.test.js +0 -22
  239. package/lib/utils/__tests__/local-storage.test.d.ts +0 -1
  240. package/lib/utils/__tests__/local-storage.test.js +0 -48
  241. package/lib/utils/__tests__/object.test.d.ts +0 -1
  242. package/lib/utils/__tests__/object.test.js +0 -45
  243. package/lib/utils/__tests__/openapi.test.d.ts +0 -1
  244. package/lib/utils/__tests__/openapi.test.js +0 -1378
  245. package/lib/utils/__tests__/path.test.d.ts +0 -1
  246. package/lib/utils/__tests__/path.test.js +0 -16
  247. package/lib/utils/__tests__/queryString.test.d.ts +0 -1
  248. package/lib/utils/__tests__/queryString.test.js +0 -60
  249. package/lib/utils/__tests__/replaceVariables.test.d.ts +0 -1
  250. package/lib/utils/__tests__/replaceVariables.test.js +0 -46
  251. package/lib/utils/__tests__/simplifyAstStructure.test.d.ts +0 -1
  252. package/lib/utils/__tests__/simplifyAstStructure.test.js +0 -26
  253. package/lib/utils/__tests__/sort.test.d.ts +0 -1
  254. package/lib/utils/__tests__/sort.test.js +0 -16
  255. package/lib/utils/__tests__/string.test.d.ts +0 -1
  256. package/lib/utils/__tests__/string.test.js +0 -16
  257. package/lib/utils/__tests__/theme-helpers.test.d.ts +0 -1
  258. package/lib/utils/__tests__/theme-helpers.test.js +0 -24
  259. package/lib/utils/__tests__/url.test.d.ts +0 -1
  260. package/lib/utils/__tests__/url.test.js +0 -134
@@ -1 +0,0 @@
1
- export {};
@@ -1,16 +0,0 @@
1
- import { normalizePath } from '../path.js';
2
- describe('path utils', () => {
3
- test('normalizePath should return correct path', () => {
4
- const expectedResult = '/test/path';
5
- expect(normalizePath('test/path')).toBe(expectedResult);
6
- expect(normalizePath('test/path/')).toBe(expectedResult);
7
- expect(normalizePath('/test/path/')).toBe(expectedResult);
8
- expect(normalizePath('/test/path')).toBe(expectedResult);
9
- });
10
- test('normalizePath should handle root path', () => {
11
- const expectedResult = '/';
12
- expect(normalizePath('/')).toBe(expectedResult);
13
- expect(normalizePath('')).toBe(expectedResult);
14
- });
15
- });
16
- //# sourceMappingURL=path.test.js.map
@@ -1 +0,0 @@
1
- export {};
@@ -1,60 +0,0 @@
1
- import { queryString } from '../queryString.js';
2
- describe('QueryString', () => {
3
- describe('parse', () => {
4
- it('should parse an empty query string', () => {
5
- const result = queryString.parse('');
6
- expect(result).toEqual({});
7
- });
8
- it('should parse a query string with a single key-value pair', () => {
9
- const result = queryString.parse('?key=value');
10
- expect(result).toEqual({ key: 'value' });
11
- });
12
- it('should parse a query string with multiple key-value pairs', () => {
13
- const result = queryString.parse('key1=value1&key2=value2');
14
- expect(result).toEqual({ key1: 'value1', key2: 'value2' });
15
- });
16
- it('should decode special characters in keys and values', () => {
17
- const result = queryString.parse('?key%21=value%2B');
18
- expect(result).toEqual({ 'key!': 'value+' });
19
- });
20
- it('should parse a matrix array value', () => {
21
- const result = queryString.parse('key=value1&key=value2');
22
- expect(result).toEqual({ key: ['value1', 'value2'] });
23
- });
24
- it('should parse an array value with comma separator', () => {
25
- const result = queryString.parse('key=value1,value2,value3');
26
- expect(result).toEqual({ key: ['value1', 'value2', 'value3'] });
27
- });
28
- it('should parse an array value with pipe separator', () => {
29
- const result = queryString.parse('key=value1|value2');
30
- expect(result).toEqual({ key: ['value1', 'value2'] });
31
- });
32
- });
33
- describe('stringify', () => {
34
- it('should stringify an empty object', () => {
35
- const result = queryString.stringify({});
36
- expect(result).toBe('');
37
- });
38
- it('should stringify a single key-value pair', () => {
39
- const result = queryString.stringify({ key: 'value' });
40
- expect(result).toBe('key=value');
41
- });
42
- it('should stringify multiple key-value pairs', () => {
43
- const result = queryString.stringify({ key1: 'value1', key2: 'value2' });
44
- expect(result).toBe('key1=value1&key2=value2');
45
- });
46
- it('should stringify an array value', () => {
47
- const result = queryString.stringify({ key: ['value1', 'value2'] });
48
- expect(result).toBe('key=value1&key=value2');
49
- });
50
- it('should sort key-value pairs if options.sort is true', () => {
51
- const result = queryString.stringify({ key2: 'value2', key1: 'value1' }, { sort: true });
52
- expect(result).toBe('key1=value1&key2=value2');
53
- });
54
- it('should not sort key-value pairs if options.sort is false', () => {
55
- const result = queryString.stringify({ key2: 'value2', key1: 'value1' }, { sort: false });
56
- expect(result).toBe('key2=value2&key1=value1');
57
- });
58
- });
59
- });
60
- //# sourceMappingURL=queryString.test.js.map
@@ -1 +0,0 @@
1
- export {};
@@ -1,46 +0,0 @@
1
- import { replaceVariables } from '../replaceVariables.js';
2
- describe('replaceVariables', () => {
3
- test('should return the same URL when there are no variables', () => {
4
- const server = {
5
- url: 'https://api.example.com',
6
- };
7
- expect(replaceVariables(server)).toBe('https://api.example.com');
8
- });
9
- test('should replace variables in the URL with their default values', () => {
10
- const server = {
11
- url: 'https://api.example.com/{version}/endpoint',
12
- variables: {
13
- version: {
14
- default: 'v1',
15
- },
16
- },
17
- };
18
- expect(replaceVariables(server)).toBe('https://api.example.com/v1/endpoint');
19
- });
20
- test('should replace multiple variables in the URL with their default values', () => {
21
- const server = {
22
- url: 'https://api.example.com/{version}/{resource}',
23
- variables: {
24
- version: {
25
- default: 'v1',
26
- },
27
- resource: {
28
- default: 'users',
29
- },
30
- },
31
- };
32
- expect(replaceVariables(server)).toBe('https://api.example.com/v1/users');
33
- });
34
- test('should handle multiple occurrences of the same variable in the URL', () => {
35
- const server = {
36
- url: 'https://api.example.com/{version}/endpoint/{version}',
37
- variables: {
38
- version: {
39
- default: 'v1',
40
- },
41
- },
42
- };
43
- expect(replaceVariables(server)).toBe('https://api.example.com/v1/endpoint/v1');
44
- });
45
- });
46
- //# sourceMappingURL=replaceVariables.test.js.map
@@ -1 +0,0 @@
1
- export {};
@@ -1,26 +0,0 @@
1
- import { Node } from '@markdoc/markdoc';
2
- import { simplifyAstStructure } from '../simplifyAstStructure.js';
3
- describe('simplifyAstStructure', () => {
4
- it('should remove location from AST nodes', () => {
5
- const mockAst = new Node('document', {}, [
6
- new Node('paragraph', {}, [new Node('text', { content: 'Hello world' })]),
7
- ]);
8
- const result = simplifyAstStructure(mockAst);
9
- expect(result.location).toBeUndefined();
10
- expect(result[0].location).toBeUndefined();
11
- expect(result[0].children[0].location).toBeUndefined();
12
- expect(result).toMatchSnapshot();
13
- });
14
- it('should handle empty AST', () => {
15
- const mockAst = new Node('document', {}, []);
16
- const result = simplifyAstStructure(mockAst);
17
- expect(result.location).toBeUndefined();
18
- expect(result).toMatchSnapshot();
19
- });
20
- it('should return full AST when not a document node type', () => {
21
- const mockAst = new Node('text', { content: 'Some text' });
22
- const result = simplifyAstStructure(mockAst);
23
- expect(result).toMatchSnapshot();
24
- });
25
- });
26
- //# sourceMappingURL=simplifyAstStructure.test.js.map
@@ -1 +0,0 @@
1
- export {};
@@ -1,16 +0,0 @@
1
- import { alphabeticallyByProp } from '../sort.js';
2
- describe('alphabeticallyByProp', () => {
3
- test('should sort objects by property in ascending order', () => {
4
- const testData = [{ name: 'Charlie' }, { name: 'Alice' }, { name: 'Bob' }, { name: 'David' }];
5
- const comparator = alphabeticallyByProp('name');
6
- const sorted = [...testData].sort(comparator);
7
- expect(sorted.map((item) => item.name)).toEqual(['Alice', 'Bob', 'Charlie', 'David']);
8
- });
9
- test('should sort objects by property in descending order when property starts with dash', () => {
10
- const testData = [{ name: 'Charlie' }, { name: 'Alice' }, { name: 'Bob' }, { name: 'David' }];
11
- const comparator = alphabeticallyByProp('-name');
12
- const sorted = [...testData].sort(comparator);
13
- expect(sorted.map((item) => item.name)).toEqual(['David', 'Charlie', 'Bob', 'Alice']);
14
- });
15
- });
16
- //# sourceMappingURL=sort.test.js.map
@@ -1 +0,0 @@
1
- export {};
@@ -1,16 +0,0 @@
1
- import slugify from 'slugify';
2
- import { strikethroughText, safeSlugify } from '../string.js';
3
- describe('string utils', () => {
4
- it('strikethroughText', () => {
5
- expect(strikethroughText('text')).toEqual('t̵e̵x̵t̵');
6
- });
7
- test('slugifyIfAvailable returns original value when cannot slugify the value', () => {
8
- const willBeSlugifed = safeSlugify('some string');
9
- expect(willBeSlugifed).toEqual('some-string');
10
- const cannotBeSlugified = '가나다라 마바사';
11
- // if slugify() fixes this issue, safeSlugify should be removed and replaced with original one.
12
- expect(slugify(cannotBeSlugified)).toEqual('');
13
- expect(safeSlugify(cannotBeSlugified)).toEqual('가나다라-마바사');
14
- });
15
- });
16
- //# sourceMappingURL=string.test.js.map
@@ -1 +0,0 @@
1
- export {};
@@ -1,24 +0,0 @@
1
- import { getTypographyCssRulesByComponentName } from '../theme-helpers.js';
2
- describe('getTypographyCssRulesByComponentName', () => {
3
- it('should return object with defined css variable for component', () => {
4
- expect(getTypographyCssRulesByComponentName('component')).toEqual({
5
- fontSize: 'var(--component-font-size)',
6
- fontWeight: 'var(--component-font-weight)',
7
- fontFamily: 'var(--component-font-family)',
8
- lineHeight: 'var(--component-line-height)',
9
- color: 'var(--component-text-color)',
10
- textTransform: 'var(--component-text-transform)',
11
- });
12
- });
13
- it('should return object with fallback', () => {
14
- expect(getTypographyCssRulesByComponentName('component', 'component1')).toEqual({
15
- fontSize: 'var(--component-font-size,var(--component1-font-size))',
16
- fontWeight: 'var(--component-font-weight,var(--component1-font-weight))',
17
- fontFamily: 'var(--component-font-family,var(--component1-font-family))',
18
- lineHeight: 'var(--component-line-height,var(--component1-line-height))',
19
- color: 'var(--component-text-color,var(--component1-text-color))',
20
- textTransform: 'var(--component-text-transform,var(--component1-text-transform))',
21
- });
22
- });
23
- });
24
- //# sourceMappingURL=theme-helpers.test.js.map
@@ -1 +0,0 @@
1
- export {};
@@ -1,134 +0,0 @@
1
- import { urlParse, getUrlDirname } from '../url.js';
2
- describe('url utils', () => {
3
- const originalConsoleError = console.error;
4
- beforeEach(() => {
5
- console.error = vi.fn();
6
- });
7
- afterEach(() => {
8
- console.error = originalConsoleError;
9
- });
10
- describe('urlParse', () => {
11
- it('should parse valid URLs', () => {
12
- const result = urlParse('https://example.com/path');
13
- expect(result).toBeInstanceOf(URL);
14
- expect(result?.href).toBe('https://example.com/path');
15
- });
16
- it('should parse URLs with query parameters', () => {
17
- const result = urlParse('https://api.example.com/v1/users?id=123&name=test');
18
- expect(result).toBeInstanceOf(URL);
19
- expect(result?.searchParams.get('id')).toBe('123');
20
- expect(result?.searchParams.get('name')).toBe('test');
21
- });
22
- it('should parse URLs with fragments', () => {
23
- const result = urlParse('https://example.com/page#section1');
24
- expect(result).toBeInstanceOf(URL);
25
- expect(result?.hash).toBe('#section1');
26
- });
27
- it('should handle slashesDenoteHost parameter when true', () => {
28
- const result = urlParse('//example.com/api', true);
29
- expect(result).toBeInstanceOf(URL);
30
- expect(result?.hostname).toBe('example.com');
31
- expect(result?.pathname).toBe('/api');
32
- });
33
- it('should handle URLs with ports', () => {
34
- const result = urlParse('https://example.com:8080/api');
35
- expect(result).toBeInstanceOf(URL);
36
- expect(result?.port).toBe('8080');
37
- });
38
- it('should handle URLs with authentication', () => {
39
- const result = urlParse('https://user:pass@example.com/api');
40
- expect(result).toBeInstanceOf(URL);
41
- expect(result?.username).toBe('user');
42
- expect(result?.password).toBe('pass');
43
- });
44
- it('should return null for invalid URLs', () => {
45
- const result = urlParse('not-a-valid-url');
46
- expect(result).toBeNull();
47
- });
48
- it('should return null for empty string', () => {
49
- const result = urlParse('');
50
- expect(result).toBeNull();
51
- });
52
- it('should return null for malformed URLs', () => {
53
- const result = urlParse('http://');
54
- expect(result).toBeNull();
55
- });
56
- it('should handle URLs with special characters', () => {
57
- const result = urlParse('https://example.com/path with spaces');
58
- expect(result).toBeInstanceOf(URL);
59
- expect(result?.pathname).toBe('/path%20with%20spaces');
60
- });
61
- it('should handle URLs with unicode characters', () => {
62
- const result = urlParse('https://example.com/测试');
63
- expect(result).toBeInstanceOf(URL);
64
- expect(result?.pathname).toBe('/%E6%B5%8B%E8%AF%95');
65
- });
66
- });
67
- describe('getUrlDirname', () => {
68
- it('should return directory path for URLs ending with slash', () => {
69
- const result = getUrlDirname('https://example.com/api/');
70
- expect(result).toBe('https://example.com/api/');
71
- });
72
- it('should return directory path for URLs not ending with slash', () => {
73
- const result = getUrlDirname('https://example.com/api/users');
74
- expect(result).toBe('https://example.com/api/');
75
- });
76
- it('should return root path for URLs with no path segments', () => {
77
- const result = getUrlDirname('https://example.com');
78
- expect(result).toBe('https://example.com/');
79
- });
80
- it('should return root path for URLs with single path segment', () => {
81
- const result = getUrlDirname('https://example.com/api');
82
- expect(result).toBe('https://example.com/');
83
- });
84
- it('should handle URLs with query parameters', () => {
85
- const result = getUrlDirname('https://example.com/api/users?id=123');
86
- expect(result).toBe('https://example.com/api/');
87
- });
88
- it('should handle URLs with fragments', () => {
89
- const result = getUrlDirname('https://example.com/api/users#section');
90
- expect(result).toBe('https://example.com/api/');
91
- });
92
- it('should handle URLs with ports', () => {
93
- const result = getUrlDirname('https://example.com:8080/api/users');
94
- expect(result).toBe('https://example.com:8080/api/');
95
- });
96
- it('should handle URLs with multiple consecutive slashes', () => {
97
- const result = getUrlDirname('https://example.com/api//users');
98
- expect(result).toBe('https://example.com/api//');
99
- });
100
- it('should handle URLs with trailing slashes in path', () => {
101
- const result = getUrlDirname('https://example.com/api/users/');
102
- expect(result).toBe('https://example.com/api/users/');
103
- });
104
- it('should return undefined for invalid URLs', () => {
105
- const result = getUrlDirname('not-a-valid-url');
106
- expect(result).toBeUndefined();
107
- });
108
- it('should return undefined for empty string', () => {
109
- const result = getUrlDirname('');
110
- expect(result).toBeUndefined();
111
- });
112
- it('should handle URLs with special characters in path', () => {
113
- const result = getUrlDirname('https://example.com/api/users with spaces');
114
- expect(result).toBe('https://example.com/api/');
115
- });
116
- it('should handle URLs with unicode characters in path', () => {
117
- const result = getUrlDirname('https://example.com/api/测试/users');
118
- expect(result).toBe('https://example.com/api/%E6%B5%8B%E8%AF%95/');
119
- });
120
- it('should return undefined for relative URLs', () => {
121
- const result = getUrlDirname('/api/users/profile');
122
- expect(result).toBeUndefined();
123
- });
124
- it('should return undefined for relative URLs with single segment', () => {
125
- const result = getUrlDirname('/api');
126
- expect(result).toBeUndefined();
127
- });
128
- it('should return undefined for relative URLs ending with slash', () => {
129
- const result = getUrlDirname('/api/users/');
130
- expect(result).toBeUndefined();
131
- });
132
- });
133
- });
134
- //# sourceMappingURL=url.test.js.map