@salesforcedevs/sfdocs-e2e 1.0.8-alpha.0 → 1.0.8

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/sfdocs-e2e",
3
- "version": "1.0.8-alpha.0",
3
+ "version": "1.0.8",
4
4
  "description": "E2E test suite for SFDocs static portal pages (SSG)",
5
5
  "license": "ISC",
6
6
  "bin": {
@@ -4,9 +4,5 @@ exports.config = {
4
4
  ...BASE_CONFIG.config,
5
5
  baseUrl: process.env.E2E_BASE_URL || 'http://localhost:3001',
6
6
  specs: ['./src/portal/specs/**/*.test.ts', './src/shared/specs/*.test.ts'],
7
- exclude: [
8
- './src/shared/specs/contentActionToolbar.test.ts',
9
- // Advanced liquid tests require previewFuture — not enabled in portal builds
10
- './src/shared/specs/liquid-advanced.test.ts',
11
- ],
7
+ exclude: ['./src/shared/specs/contentActionToolbar.test.ts'],
12
8
  };
@@ -27,6 +27,21 @@ describe('Liquid Template Rendering — Advanced', () => {
27
27
  }
28
28
  });
29
29
 
30
+ it('Should render repository-level variables from content-config.yml', async function () {
31
+ if (!liquidEnabled) {
32
+ this.skip();
33
+ }
34
+
35
+ const content = await $('>>>doc-content-layout');
36
+ const text = await content.getText();
37
+ const html = await content.getHTML();
38
+
39
+ expect(text.includes('Salesforce Platform')).toBeTruthy();
40
+ expect(text.includes('62.0')).toBeTruthy();
41
+ expect(text.includes('sf')).toBeTruthy();
42
+ expect(html.includes('{{ variables.platform')).toBeFalsy();
43
+ });
44
+
30
45
  it('Should render future block content when previewFuture is enabled', async function () {
31
46
  if (!liquidEnabled) {
32
47
  this.skip();
@@ -12,21 +12,8 @@ describe('Liquid Template Rendering', () => {
12
12
 
13
13
  const content = await $('>>>doc-content-layout');
14
14
  const text = await content.getText();
15
- const html = await content.getHTML();
16
-
17
- const hasLiquidOutput = text.includes('Hello from data.yaml');
18
- const hasRawSyntax =
19
- html.includes('{% assign') ||
20
- html.includes('{% include') ||
21
- html.includes('{{ data.greeting }}');
22
-
23
- if (hasRawSyntax) {
24
- liquidEnabled = false;
25
- } else if (hasLiquidOutput) {
26
- liquidEnabled = true;
27
- } else {
28
- liquidEnabled = false;
29
- }
15
+
16
+ liquidEnabled = text.includes('Hello from data.yaml');
30
17
  } catch (e) {
31
18
  liquidEnabled = false;
32
19
  }
@@ -52,21 +39,6 @@ describe('Liquid Template Rendering', () => {
52
39
  expect(text.includes('Hello from data.yaml')).toBeTruthy();
53
40
  });
54
41
 
55
- it('Should render repository-level variables from content-config.yml', async function () {
56
- if (!liquidEnabled) {
57
- this.skip();
58
- }
59
-
60
- const content = await $('>>>doc-content-layout');
61
- const text = await content.getText();
62
- const html = await content.getHTML();
63
-
64
- expect(text.includes('Salesforce Platform')).toBeTruthy();
65
- expect(text.includes('62.0')).toBeTruthy();
66
- expect(text.includes('sf')).toBeTruthy();
67
- expect(html.includes('{{ variables.platform')).toBeFalsy();
68
- });
69
-
70
42
  it('Should render included templates from shared directory', async function () {
71
43
  if (!liquidEnabled) {
72
44
  this.skip();
@@ -87,39 +59,31 @@ describe('Liquid Template Rendering', () => {
87
59
  }
88
60
 
89
61
  const content = await $('>>>doc-content-layout');
90
- const html = await content.getHTML();
91
62
  const text = await content.getText();
92
63
 
93
- expect(text.includes('create()')).toBeTruthy();
94
- expect(text.includes('query()')).toBeTruthy();
95
- expect(text.includes('update()')).toBeTruthy();
64
+ expect(text.includes('AccountId')).toBeTruthy();
65
+ expect(text.includes('Type:')).toBeTruthy();
66
+ expect(text.includes('Properties:')).toBeTruthy();
96
67
 
97
68
  const listItems = await content.$$('li');
98
69
  expect(listItems.length).toBeGreaterThan(5);
99
-
100
- expect(text.includes('supported_calls')).toBeFalsy();
101
- expect(html.includes('for call in supported_calls')).toBeFalsy();
102
70
  });
103
71
 
104
- it('Should resolve {{ }} outputs inside code blocks but keep {% %} tags literal', async function () {
72
+ it('Should not process Liquid syntax inside code blocks', async function () {
105
73
  if (!liquidEnabled) {
106
74
  this.skip();
107
75
  }
108
76
 
109
- const codeBlockElement = await $('>>>.code-block-content');
110
- const codeBlock = await codeBlockElement.shadow$('code');
77
+ const content = await $('>>>doc-content-layout');
78
+ const codeBlock = await content.$('dx-code-block');
111
79
 
112
80
  expect(await codeBlock.isExisting()).toBeTruthy();
113
81
 
114
- const codeText = await codeBlock.getText();
115
- expect(codeText.includes('{{ data.greeting }}')).toBeFalsy();
116
- expect(codeText.includes('{{ topic }}')).toBeFalsy();
117
- expect(codeText.includes('Hello from data.yaml')).toBeTruthy();
118
- expect(codeText.includes('GitHub for writers')).toBeTruthy();
119
- expect(codeText.includes('{% for item in items %}')).toBeTruthy();
120
- expect(codeText.includes('{{ item }}')).toBeTruthy();
82
+ const codeBlockAttr = await codeBlock.getAttribute('code-block');
83
+ expect(codeBlockAttr.includes('{{ data.greeting }}')).toBeTruthy();
84
+ expect(codeBlockAttr.includes('{{ topic }}')).toBeTruthy();
85
+ expect(codeBlockAttr.includes('{% for item in items %}')).toBeTruthy();
121
86
 
122
- const content = await $('>>>doc-content-layout');
123
87
  const text = await content.getText();
124
88
  expect(text.includes('Visit')).toBeTruthy();
125
89
  });
@@ -18,6 +18,7 @@ exports.config = {
18
18
 
19
19
  // Exclude tests that require dynamic server features or pages not in static build
20
20
  exclude: [
21
+ // './src/shared/specs/liquid.test.ts',
21
22
  './src/portal/specs/docs.api.test.ts',
22
23
  './src/portal/specs/docs.test.ts',
23
24
  './src/shared/specs/banner.test.ts',