@diplodoc/cli-tests 5.15.4 → 5.15.7

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.
@@ -9,13 +9,15 @@ const generateMapTestTemplate = (
9
9
  testRootPath: string,
10
10
  args: TranslateRunArgs,
11
11
  ignoreFileContent = true,
12
+ // TODO: added especialy for 'extract openapi spec files with custom openapi schema provided' test, arc test issue
13
+ ignoreFileList = false,
12
14
  ) => {
13
15
  test(testTitle, async () => {
14
16
  const {inputPath, outputPath} = getTestPaths(testRootPath);
15
17
 
16
18
  await TestAdapter.testTranslatePass(inputPath, outputPath, args);
17
19
 
18
- await compareDirectories(outputPath, ignoreFileContent);
20
+ await compareDirectories(outputPath, ignoreFileContent, false, ignoreFileList);
19
21
  });
20
22
  };
21
23
 
@@ -67,9 +69,9 @@ describe('Translate command', () => {
67
69
  target: 'es-ES',
68
70
  });
69
71
 
70
- generateFilesYamlTestTemplate(
72
+ generateMapTestTemplate(
71
73
  'extract openapi spec files with custom openapi schema provided',
72
- 'mocks/translation/custom-schema',
74
+ 'mocks/translation/openapi',
73
75
  {
74
76
  subcommand: 'extract',
75
77
  source: 'ru-RU',
@@ -77,6 +79,8 @@ describe('Translate command', () => {
77
79
  additionalArgs:
78
80
  '--schema mocks/translation/custom-schema/custom-openapi-schema-30.yaml',
79
81
  },
82
+ false,
83
+ true,
80
84
  );
81
85
 
82
86
  generateFilesYamlTestTemplate('compose openapi spec files', 'mocks/translation/compose', {
@@ -57,6 +57,7 @@ export async function compareDirectories(
57
57
  outputPath: string,
58
58
  ignoreFileContent = false,
59
59
  checkBundle = false,
60
+ ignoreFileList = false,
60
61
  ) {
61
62
  const filesFromOutput = (
62
63
  await glob(`**/*`, {
@@ -84,7 +85,9 @@ export async function compareDirectories(
84
85
  // We sort only the final list and put it in the snapshot
85
86
  filesForSnapshot = filesForSnapshot.map(hashless).sort();
86
87
 
87
- expect(JSON.stringify(filesForSnapshot, null, 2)).toMatchSnapshot('filelist');
88
+ if (!ignoreFileList) {
89
+ expect(JSON.stringify(filesForSnapshot, null, 2)).toMatchSnapshot('filelist');
90
+ }
88
91
 
89
92
  if (!ignoreFileContent) {
90
93
  filesFromOutput
@@ -1 +1 @@
1
- langs: ['ru', 'en', 'az']
1
+ langs: ['ru', 'en', {'lang': 'az', 'tld': 'az'}]
@@ -1,6 +1,6 @@
1
1
  # Header
2
2
 
3
- ![_images/versions.png]
3
+ ![](_images/versions.png)
4
4
 
5
5
  ::: page-constructor
6
6
  blocks:
@@ -11,9 +11,8 @@ blocks:
11
11
  controlPosition: 'content'
12
12
  - type: 'basic-card'
13
13
  title: 'Заголовок 2'
14
- text: '![_images/camera.svg]'
14
+ text: '![](_images/versions.png)'
15
15
  border: 'shadow'
16
16
  controlPosition: 'content'
17
- image:
18
- icon: '_images/icons/bulb.svg'
17
+ icon: '_images/icons/bulb.svg'
19
18
  :::
@@ -4,4 +4,4 @@ blocks:
4
4
  text: 'Текст'
5
5
  border: 'shadow'
6
6
  controlPosition: 'content'
7
- image: '_images/mountain.jpg'
7
+ icon: '_images/mountain.jpg'
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 20.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg width="20px" height="20px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" id="search" version="1.1" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
4
+ <g id="search_1_">
5
+ <linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="57.9473" x2="407.9511" y1="351.4531" y2="149.3783">
6
+ <stop offset="0" stop-color="#F14D5C"/>
7
+ <stop offset="0.1309" stop-color="#F05454"/>
8
+ <stop offset="0.3346" stop-color="#3bf488"/>
9
+ <stop offset="0.3492"
10
+ stop-color="#ED683C"/>
11
+ <stop offset="0.714" stop-color="#1e15a3"/>
12
+ <stop offset="1" stop-color="#FDC70C"/>
13
+ </linearGradient>
14
+ <path d="M300.766,87.509c-33.056,0-64.133,12.873-87.507,36.246c-23.374,23.374-36.247,54.451-36.247,87.507
15
+ c0,24.234,6.927,47.4,19.83,67.252l-12.669,12.669c0,0.001-0.001,0.001-0.001,0.001l-90.664,90.665 c-8.353,8.354-7.88,22.418,1.055,31.353l4.261,4.262c4.669,4.668,10.736,7.028,16.658,7.028c5.417,0,10.713-1.976,14.703-5.966 l15.405-15.405l75.259-75.259l12.671-12.672c19.85,12.9,43.014,19.826,67.246,19.826c33.056,0,64.133-12.873,87.506-36.247 c48.252-48.251,48.252-126.762,0-175.014C364.898,100.382,333.821,87.509,300.766,87.509z M138.518,396.049 c-4.454,4.453-12.178,3.979-17.219-1.063l-4.261-4.262c-5.036-5.035-5.509-12.756-1.055-17.21l71.38-71.38 c3.284,4.164,6.834,8.16,10.601,11.926c3.766,3.766,7.764,7.318,11.935,10.607L138.518,396.049z M105.894,410.391l-4.261-4.26 c-5.036-5.036-5.509-12.757-1.055-17.211l2.902-2.902c0.936,4.27,3.101,8.393,6.486,11.779l4.261,4.26 c3.392,3.393,7.523,5.549,11.799,6.483l-2.914,2.914C118.658,415.908,110.934,415.432,105.894,410.391z M213.788,320.779 c0.002-0.003,0.005-0.006,0.007-0.008l0,0L213.788,320.779z M217.033,317.534c-4.201-3.248-8.229-6.775-11.998-10.544 c-3.771-3.771-7.295-7.797-10.537-11.99l8.214-8.214c3.233,4.181,6.749,8.185,10.547,11.982c3.8,3.8,7.806,7.317,11.989,10.552 L217.033,317.534z M381.201,291.697c-21.485,21.485-50.052,33.318-80.436,33.318c-30.385,0-58.951-11.833-80.436-33.318 c-21.485-21.484-33.318-50.051-33.318-80.436s11.833-58.95,33.318-80.436c21.485-21.485,50.051-33.317,80.436-33.317 c30.384,0,58.95,11.832,80.436,33.317C425.553,175.179,425.553,247.346,381.201,291.697z" fill="url(#SVGID_1_)"/>
16
+ <path d="M258.117,115.27l3.604,9.328c2.592-1.001,5.267-1.887,7.949-2.632l-2.676-9.636 C263.998,113.162,261.012,114.151,258.117,115.27z" fill="#3bf488ff"/>
17
+ <path d="M206.264,162.886l8.985,4.389c8.299-16.992,22.191-30.997,39.118-39.433l-4.46-8.95 C231.022,128.304,215.523,143.928,206.264,162.886z" fill="#1e15a3ff"/>
18
+ </g>
19
+ </svg>
@@ -64,6 +64,13 @@ Term
64
64
  15. `![code svg image 15][code]{inline=true}`
65
65
  ![svg image 15][code]{inline=true}
66
66
 
67
+ 16. `![svg with xml header](_assets/2.svg)`
68
+ ![svg with xml header](_assets/2.svg)
69
+
70
+ 17. Text link `backtick`.
71
+ ![Text link `backtick`](_assets/1.svg "Text link title `backtick`"){ width="100" }
72
+ Text link `backtick`.
73
+
67
74
  20. Сodeblocks - no inline svg
68
75
  ```
69
76
  Codeblock fence
@@ -105,3 +112,50 @@ Codeblock with inline code
105
112
  `![code svg image 22](_assets/1.svg)`
106
113
  1. ![code svg image 23](_assets/1.svg)
107
114
  ```
115
+
116
+ 1. Codeblock in table with asset
117
+
118
+ #|
119
+ || **col1** | **col2** | **col3** ||
120
+ || col1 |
121
+ ```swift
122
+ some code ![svg image 24](_assets/1.svg =120x)
123
+ ``` | ![svg image 24](_assets/1.svg =120x) ||
124
+ |#
125
+
126
+ 1. Codeblock in cat
127
+
128
+ {% cut "first level" %}
129
+
130
+ ![svg image 25](_assets/1.svg)
131
+ ```md
132
+ ![code svg image 25](_assets/1.svg)
133
+ ```
134
+ {% cut "second level" %}
135
+
136
+ ![svg image 25](_assets/1.svg)
137
+
138
+ ```md
139
+ ![code svg image 26](_assets/1.svg)
140
+ ```
141
+
142
+ {% endcut %}
143
+
144
+ {% endcut %}
145
+
146
+ 1. Codeblock in tabs
147
+
148
+ {% list tabs %}
149
+ - first
150
+
151
+ ![svg image 25](_assets/1.svg)
152
+ ```md
153
+ ![code svg image 25](_assets/1.svg)
154
+ ```
155
+ - second
156
+
157
+ ![svg image 25](_assets/1.svg)
158
+ ```md
159
+ ![code svg image 25](_assets/1.svg)
160
+ ```
161
+ {% endlist %}
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@diplodoc/cli-tests",
3
- "version": "5.15.4",
3
+ "version": "5.15.7",
4
4
  "bin": {
5
5
  "diplodoc-cli-test": "bin.mjs"
6
6
  },
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git@github.com:diplodoc-platform/cli.git"
10
+ },
7
11
  "exports": {
8
12
  "./fixtures": "./fixtures/index.ts"
9
13
  },
@@ -1,42 +0,0 @@
1
- openapi: 3.0.1
2
- info:
3
- title: OpenAPI definition
4
- version: v0
5
- servers:
6
- - url: http://localhost:8080
7
- description: Generated server url
8
- paths:
9
- /test:
10
- get:
11
- tags:
12
- - test-controller
13
- summary: Simple get operation. тест новой верстки 3
14
- description: Defines a simple get operation with no inputs and a complex
15
- operationId: getWithPayloadResponse
16
- responses:
17
- "200":
18
- description: 200!!!!
19
- content:
20
- application/json:
21
- schema:
22
- $ref: '#/components/schemas/RecurceTop'
23
- components:
24
- schemas:
25
- RecurceTop:
26
- type: object
27
- properties:
28
- A:
29
- type: string
30
- description: |
31
- Статус загрузки:
32
- - `UPLOADED` — загрузка завершена.
33
- - `IN_PROGRESS` — загрузка находится в процессе обработки.
34
- - `PROCESSED` — загрузка успешно обработана.
35
- # $ref: '#/components/schemas/RecurceMiddle'
36
- RecurceMiddle:
37
- type: object
38
- properties:
39
- B:
40
- type: array
41
- items:
42
- $ref: '#/components/schemas/RecurceTop'
@@ -1,8 +0,0 @@
1
- items:
2
- - name: openapi
3
- include:
4
- path: openapi
5
- includers:
6
- - name: openapi
7
- input: openapi-spec.yaml
8
- mode: link