@diplodoc/cli-tests 5.39.2 → 5.39.3

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.
@@ -0,0 +1,92 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`Includes with conditions > Consecutive includes with false condition in the middle > filelist 1`] = `
4
+ "[
5
+ "includes/first-hash.md",
6
+ "includes/second-hash.md",
7
+ "includes/third-hash.md",
8
+ "index.md",
9
+ "toc.yaml"
10
+ ]"
11
+ `;
12
+
13
+ exports[`Includes with conditions > Consecutive includes with false condition in the middle > filelist 2`] = `
14
+ "[
15
+ "index.html",
16
+ "toc.js"
17
+ ]"
18
+ `;
19
+
20
+ exports[`Includes with conditions > Consecutive includes with false condition in the middle 1`] = `
21
+ "{% note info %}
22
+
23
+ This is the first include.
24
+
25
+ {% endnote %}
26
+ "
27
+ `;
28
+
29
+ exports[`Includes with conditions > Consecutive includes with false condition in the middle 2`] = `
30
+ "
31
+ "
32
+ `;
33
+
34
+ exports[`Includes with conditions > Consecutive includes with false condition in the middle 3`] = `
35
+ "This is the third include.
36
+ "
37
+ `;
38
+
39
+ exports[`Includes with conditions > Consecutive includes with false condition in the middle 4`] = `
40
+ "---
41
+ metadata:
42
+ - name: generator
43
+ content: Diplodoc Platform vDIPLODOC-VERSION
44
+ vcsPath: index.md
45
+ ---
46
+ # Test Includes Conditions
47
+
48
+ {% include [first](includes/first-hash.md) %}
49
+
50
+ {% include [second](includes/second-hash.md) %}
51
+
52
+ {% include [third](includes/third-hash.md) %}
53
+ "
54
+ `;
55
+
56
+ exports[`Includes with conditions > Consecutive includes with false condition in the middle 5`] = `
57
+ "items:
58
+ - name: Test Includes Conditions
59
+ href: index.md
60
+ path: toc.yaml
61
+ "
62
+ `;
63
+
64
+ exports[`Includes with conditions > Consecutive includes with false condition in the middle 6`] = `
65
+ "<!DOCTYPE html>
66
+ <html lang="ru" dir="ltr">
67
+ <head>
68
+ <meta charset="utf-8">
69
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
70
+ <base href="./" />
71
+ <title>Test Includes Conditions</title>
72
+ <meta name="generator" content="Diplodoc Platform vDIPLODOC-VERSION">
73
+ <style type="text/css">html, body {min-height:100vh; height:100vh;}</style>
74
+ </head>
75
+ <body class="g-root g-root_theme_light">
76
+ <div id="root"></div>
77
+ <script type="application/json" id="diplodoc-state">
78
+ {"data":{"leading":false,"html":"&lt;div class=\\"yfm-note yfm-accent-info\\" note-type=\\"info\\"&gt;&lt;p class=\\"yfm-note-title\\"&gt;Примечание&lt;/p&gt;/n&lt;div class=\\"yfm-note-content\\"&gt;&lt;p&gt;This is the first include.&lt;/p&gt;/n&lt;/div&gt;&lt;/div&gt;&lt;p&gt;This is the third include.&lt;/p&gt;/n","meta":{"metadata":[{"name":"generator","content":"Diplodoc Platform vDIPLODOC-VERSION"}],"vcsPath":"index.md"},"headings":[],"title":"Test Includes Conditions"},"router":{"pathname":"index","depth":1,"base":"./"},"lang":"ru","langs":["ru"],"viewerInterface":{"toc":true,"search":true,"feedback":true}}
79
+ </script>
80
+ <script type="application/javascript">
81
+ const data = document.querySelector('script#diplodoc-state');
82
+ window.__DATA__ = JSON.parse((function unescape(string) {
83
+ return string.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
84
+ })(data.innerText));
85
+ window.STATIC_CONTENT = false;
86
+ </script>
87
+ <script type="application/javascript" defer src="toc.js"></script>
88
+ </body>
89
+ </html>"
90
+ `;
91
+
92
+ exports[`Includes with conditions > Consecutive includes with false condition in the middle 7`] = `"window.__DATA__.data.toc = {"items":[{"name":"Test Includes Conditions","href":"index.html","id":"UUID"}],"path":"toc.yaml","id":"UUID"};"`;
@@ -0,0 +1,23 @@
1
+ import {describe, test} from 'vitest';
2
+
3
+ import {TestAdapter, compareDirectories, getTestPaths} from '../fixtures';
4
+
5
+ describe('Includes with conditions', () => {
6
+ test('Consecutive includes with false condition in the middle', async () => {
7
+ const {inputPath, outputPath} = getTestPaths('mocks/includes-conditions');
8
+
9
+ // Test md2md transformation
10
+ await TestAdapter.testBuildPass(inputPath, outputPath, {
11
+ md2md: true,
12
+ md2html: false,
13
+ });
14
+ await compareDirectories(outputPath);
15
+
16
+ // Test md2html transformation
17
+ await TestAdapter.testBuildPass(outputPath, outputPath + '-html', {
18
+ md2md: false,
19
+ md2html: true,
20
+ });
21
+ await compareDirectories(outputPath + '-html');
22
+ });
23
+ });
@@ -0,0 +1,5 @@
1
+ {% note info %}
2
+
3
+ This is the first include.
4
+
5
+ {% endnote %}
@@ -0,0 +1,5 @@
1
+ {% if condition_var == true %}
2
+
3
+ This is the second include, which should be hidden.
4
+
5
+ {% endif %}
@@ -0,0 +1 @@
1
+ This is the third include.
@@ -0,0 +1,7 @@
1
+ # Test Includes Conditions
2
+
3
+ {% include [first](includes/first.md) %}
4
+
5
+ {% include [second](includes/second.md) %}
6
+
7
+ {% include [third](includes/third.md) %}
@@ -0,0 +1,2 @@
1
+ default:
2
+ condition_var: false
@@ -0,0 +1,3 @@
1
+ items:
2
+ - name: Test Includes Conditions
3
+ href: index.md
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diplodoc/cli-tests",
3
- "version": "5.39.2",
3
+ "version": "5.39.3",
4
4
  "bin": {
5
5
  "diplodoc-cli-test": "bin.mjs"
6
6
  },