@salesforcedevs/sfdocs-e2e 1.0.10 → 1.0.11-toolbar.0

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.
@@ -222,3 +222,100 @@ describe('Liquid Template Rendering', () => {
222
222
  expect(text.includes('Liquid is a templating language supported in SFDocs')).toBeTruthy();
223
223
  });
224
224
  });
225
+
226
+ describe('Liquid Template Rendering — Localized (ja-jp)', () => {
227
+ let jaLiquidEnabled = false;
228
+ const quickstartPath = '/docs/ja-jp/liquid-project/guide/liquid-quickstart.html';
229
+
230
+ before(async () => {
231
+ try {
232
+ page = new GuidePage(quickstartPath);
233
+ await browser.url(page.path);
234
+ await page.waitPageLoad();
235
+
236
+ const content = await $('>>>doc-content-layout');
237
+ const text = await content.getText();
238
+ const html = await content.getHTML();
239
+
240
+ const hasLiquidOutput = text.includes('data.yaml からこんにちは');
241
+ const hasRawSyntax =
242
+ html.includes('{% assign topic') || html.includes('{{ data.greeting }}');
243
+
244
+ jaLiquidEnabled = hasLiquidOutput && !hasRawSyntax;
245
+ } catch (e) {
246
+ jaLiquidEnabled = false;
247
+ }
248
+ });
249
+
250
+ beforeEach(async () => {
251
+ if (jaLiquidEnabled) {
252
+ page = new GuidePage(quickstartPath);
253
+ await browser.url(page.path);
254
+ await page.waitPageLoad();
255
+ }
256
+ });
257
+
258
+ it('Should render frontmatter assigns and data.yaml values in Japanese', async function () {
259
+ if (!jaLiquidEnabled) {
260
+ this.skip();
261
+ }
262
+
263
+ const content = await $('>>>doc-content-layout');
264
+ const text = await content.getText();
265
+
266
+ expect(text.includes('ライターのための GitHub')).toBeTruthy();
267
+ expect(text.includes('data.yaml からこんにちは')).toBeTruthy();
268
+ });
269
+
270
+ it('Should render repository-level variables in a localized topic', async function () {
271
+ if (!jaLiquidEnabled) {
272
+ this.skip();
273
+ }
274
+
275
+ const content = await $('>>>doc-content-layout');
276
+ const text = await content.getText();
277
+ const html = await content.getHTML();
278
+
279
+ expect(text.includes('Salesforce Platform')).toBeTruthy();
280
+ expect(text.includes('62.0')).toBeTruthy();
281
+ expect(html.includes('{{ variables.platform')).toBeFalsy();
282
+ });
283
+
284
+ it('Should render a loop and an included partial capture block in Japanese', async function () {
285
+ if (!jaLiquidEnabled) {
286
+ this.skip();
287
+ }
288
+
289
+ const content = await $('>>>doc-content-layout');
290
+ const text = await content.getText();
291
+ const html = await content.getHTML();
292
+
293
+ expect(text.includes('create()')).toBeTruthy();
294
+ expect(text.includes('再利用可能なヒント')).toBeTruthy();
295
+ expect(
296
+ text.includes('ウィジェットは Widgets API を通じて作成および管理されます'),
297
+ ).toBeTruthy();
298
+ // Dash-form tags are the fixture's real (resolved) tags; the bare "{% include %}"
299
+ // in the prose renders as literal inline code, so assert on the dash form only.
300
+ expect(html.includes('{%- include')).toBeFalsy();
301
+ expect(html.includes('{%- capture')).toBeFalsy();
302
+ });
303
+
304
+ it('Should render liquid.data object format in a localized topic', async function () {
305
+ if (!jaLiquidEnabled) {
306
+ this.skip();
307
+ }
308
+
309
+ const multiDataPage = new GuidePage('/docs/ja-jp/liquid-project/guide/multi-data.html');
310
+ await browser.url(multiDataPage.path);
311
+ await multiDataPage.waitPageLoad();
312
+
313
+ const content = await $('>>>doc-content-layout');
314
+ const text = await content.getText();
315
+ const html = await content.getHTML();
316
+
317
+ expect(text.includes('小売店舗や顧客サイト')).toBeTruthy();
318
+ expect(html.includes('{{ data.one.summary }}')).toBeFalsy();
319
+ expect(html.includes('{{ two.summary }}')).toBeFalsy();
320
+ });
321
+ });