cabloy 5.1.160 → 5.1.161

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 (23) hide show
  1. package/.cabloy-version +1 -1
  2. package/CHANGELOG.md +10 -0
  3. package/package.json +1 -1
  4. package/repo-e2e/specs/cabloy-basic.spec.ts +16 -16
  5. package/test-results/.last-run.json +2 -20
  6. package/vona/pnpm-lock.yaml +31 -121
  7. package/test-results/a-commerce-ATP-ADDR-01-aut-11dea-ss-through-Web-self-service/error-context.md +0 -238
  8. package/test-results/a-commerce-ATP-SPC-01-Coup-ef380-mantic-Admin-field-controls/error-context.md +0 -240
  9. package/test-results/a-commerce-ATP-SPC-02-Cate-9f120-on-and-publication-controls/error-context.md +0 -238
  10. package/test-results/a-commerce-ATP-SPC-02-Prod-5f92a-on-and-publication-controls/error-context.md +0 -238
  11. package/test-results/a-commerce-ATP-SPC-02-SKU--2e61e-ency-and-lifecycle-controls/error-context.md +0 -238
  12. package/test-results/a-commerce-ATP-SPC-04-Stoc-fa895--readonly-and-mutation-free/error-context.md +0 -235
  13. package/test-results/a-commerce-ATP-SPC-05-syst-fb406-e-without-mutation-controls/error-context.md +0 -238
  14. package/test-results/a-commerce-Commerce-sessio-4e963-ie-selects-raw-server-theme/error-context.md +0 -226
  15. package/test-results/a-commerce-Commerce-theme--062fe--without-hydration-mismatch/error-context.md +0 -229
  16. package/test-results/a-commerce-PayPal-browser--8672c-t-or-open-an-awaiting-order/error-context.md +0 -238
  17. package/test-results/a-commerce-Payment-callbac-f56c2--reconciles-after-hydration/error-context.md +0 -238
  18. package/test-results/a-commerce-Payment-cancell-3fc74-ified-provider-confirmation/error-context.md +0 -238
  19. package/test-results/a-commerce-Phase-50-60-aut-71d61--observes-operator-shipment/error-context.md +0 -238
  20. package/test-results/a-commerce-Phase-60-custom-407cd-ecutes-a-whole-order-refund/error-context.md +0 -238
  21. package/test-results/cabloy-basic-ATP-BASIC-TAB-e7253-and-pins-configured-columns/error-context.md +0 -240
  22. package/test-results/markdown-ATP-SPC-02-Produc-9d5c2-link-toolbar-edits-Markdown/error-context.md +0 -211
  23. package/test-results/markdown-ATP-SPC-02-Produc-9d6ea-t-editor-and-saves-Markdown/error-context.md +0 -238
@@ -1,226 +0,0 @@
1
- # Instructions
2
-
3
- - Following Playwright test failed.
4
- - Explain why, be concise, respect Playwright best practices.
5
- - Provide a snippet of code with the fix, if possible.
6
-
7
- # Test info
8
-
9
- - Name: a-commerce.spec.ts >> Commerce session SSR: theme cookie selects raw server theme
10
- - Location: repo-e2e/specs/a-commerce.spec.ts:397:1
11
-
12
- # Error details
13
-
14
- ```
15
- Error: expect(received).toBe(expected) // Object.is equality
16
-
17
- Expected: "private, no-store"
18
- Received: "no-cache, no-store, must-revalidate"
19
- ```
20
-
21
- # Test source
22
-
23
- ```ts
24
- 333 | expect(publicPageErrors).toEqual([]);
25
- 334 | expect(publicConsoleErrors).toEqual([]);
26
- 335 | } finally {
27
- 336 | await publicContext.close();
28
- 337 | }
29
- 338 | } finally {
30
- 339 | await context.close();
31
- 340 | }
32
- 341 | },
33
- 342 | );
34
- 343 |
35
- 344 | test(
36
- 345 | 'Commerce theme: public auto preference mirrors resolved media value without hydration mismatch',
37
- 346 | { tag: ['@web', '@ssr', '@theme'] },
38
- 347 | async ({ browser }) => {
39
- 348 | const context = await browser.newContext();
40
- 349 | await context.addInitScript(() => localStorage.setItem('themedark', JSON.stringify('auto')));
41
- 350 | const page = await context.newPage();
42
- 351 | await page.emulateMedia({ colorScheme: 'dark' });
43
- 352 | const pageErrors = collectPageErrors(page);
44
- 353 | const consoleErrors = collectConsoleErrors(page);
45
- 354 | try {
46
- 355 | await page.goto('/commerce', { waitUntil: 'load' });
47
- 356 | await expect(page.locator('html')).toHaveAttribute('data-zova-hydrated', 'commerce');
48
- 357 | await expect(page.locator('body')).toHaveAttribute('data-theme', 'dark');
49
- 358 | await expect
50
- 359 | .poll(() => page.evaluate(() => localStorage.getItem('themedark')))
51
- 360 | .toBe('"auto"');
52
- 361 | expect((await context.cookies()).find(cookie => cookie.name === 'themedark')?.value).toBe(
53
- 362 | 'true',
54
- 363 | );
55
- 364 | expect(pageErrors).toEqual([]);
56
- 365 | expect(consoleErrors).toEqual([]);
57
- 366 | } finally {
58
- 367 | await context.close();
59
- 368 | }
60
- 369 | },
61
- 370 | );
62
- 371 |
63
- 372 | test(
64
- 373 | 'Commerce public SSR: theme cookie does not change SSR HTML',
65
- 374 | { tag: ['@web', '@ssr', '@theme'] },
66
- 375 | async ({ request }) => {
67
- 376 | const responses = await Promise.all([
68
- 377 | request.get('/commerce'),
69
- 378 | request.get('/commerce', { headers: { Cookie: 'themedark=true' } }),
70
- 379 | request.get('/commerce', { headers: { Cookie: 'themedark=false' } }),
71
- 380 | ]);
72
- 381 | const html = await Promise.all(responses.map(response => response.text()));
73
- 382 | for (const [index, response] of responses.entries()) {
74
- 383 | expect(response.status(), `public response ${index}`).toBe(200);
75
- 384 | expect(response.headers()['cache-control'], `public response ${index}`).toBe(
76
- 385 | 'no-cache, no-store, must-revalidate',
77
- 386 | );
78
- 387 | expect(html[index].toLowerCase()).not.toContain('data-zova-hydrated');
79
- 388 | expect(html[index]).toContain('data-ssr-theme-dark-false="light"');
80
- 389 | expect(html[index]).toContain('data-ssr-theme-dark-true="dark"');
81
- 390 | expect(html[index]).not.toContain('ssr_cookie_themedark');
82
- 391 | expect(html[index]).toContain("window.matchMedia('(prefers-color-scheme: dark)')");
83
- 392 | expect(html[index]).not.toMatch(/<body[^>]*data-theme="(?:dark|light)"/);
84
- 393 | }
85
- 394 | },
86
- 395 | );
87
- 396 |
88
- 397 | test(
89
- 398 | 'Commerce session SSR: theme cookie selects raw server theme',
90
- 399 | { tag: ['@web', '@ssr', '@theme'] },
91
- 400 | async ({ browser, request }, testInfo) => {
92
- 401 | const customer = await registerCustomer(request, testInfo);
93
- 402 | const context = await browser.newContext();
94
- 403 | const page = await context.newPage();
95
- 404 | try {
96
- 405 | await login(
97
- 406 | page,
98
- 407 | '/commerce/commerce/member/address',
99
- 408 | customer.username,
100
- 409 | customer.password,
101
- 410 | 'commerce',
102
- 411 | );
103
- 412 | const origin = new URL(page.url()).origin;
104
- 413 | const authCookies = (await context.cookies()).filter(cookie => cookie.name !== 'themedark');
105
- 414 | const getSessionHtml = async (value: string) => {
106
- 415 | const sessionContext = await browser.newContext();
107
- 416 | try {
108
- 417 | await sessionContext.addCookies([
109
- 418 | ...authCookies.map(({ domain, path, ...cookie }) => ({ ...cookie, url: origin })),
110
- 419 | { name: 'themedark', value, url: origin },
111
- 420 | ]);
112
- 421 | const response = await sessionContext.request.get('/commerce/commerce/member/address');
113
- 422 | return { response, html: await response.text() };
114
- 423 | } finally {
115
- 424 | await sessionContext.close();
116
- 425 | }
117
- 426 | };
118
- 427 | for (const [value, theme] of [
119
- 428 | ['true', 'dark'],
120
- 429 | ['false', 'light'],
121
- 430 | ] as const) {
122
- 431 | const { response, html } = await getSessionHtml(value);
123
- 432 | expect(response.status()).toBe(200);
124
- > 433 | expect(response.headers()['cache-control']).toBe('private, no-store');
125
- | ^ Error: expect(received).toBe(expected) // Object.is equality
126
- 434 | expect(html).toContain(`data-theme="${theme}"`);
127
- 435 | expect(html).not.toContain('data-ssr-theme-dark-false');
128
- 436 | expect(html).not.toContain('data-ssr-theme-dark-true');
129
- 437 | expect(html).not.toContain("window.matchMedia('(prefers-color-scheme: dark)')");
130
- 438 | expect(html).toContain('Addresses');
131
- 439 | }
132
- 440 | } finally {
133
- 441 | await context.close();
134
- 442 | }
135
- 443 | },
136
- 444 | );
137
- 445 |
138
- 446 | test(
139
- 447 | 'Commerce catalogue: public sellable inventory renders after hydration',
140
- 448 | { tag: ['@web', '@flow'] },
141
- 449 | async ({ page }) => {
142
- 450 | const pageErrors = collectPageErrors(page);
143
- 451 | const response = await page.goto('/commerce', { waitUntil: 'load' });
144
- 452 | expect(response?.ok()).toBeTruthy();
145
- 453 | await expect(page.locator('html')).toHaveAttribute('data-zova-hydrated', 'commerce');
146
- 454 | await expect(page.getByRole('heading', { name: 'Commerce catalogue' })).toBeVisible();
147
- 455 | await expect(page.getByRole('link', { name: 'Wireless Headphones' })).toBeVisible();
148
- 456 | await expect(page.getByText('24 available')).toBeVisible();
149
- 457 | await page.getByRole('link', { name: 'Wireless Headphones' }).click();
150
- 458 | await expect(page).toHaveURL(/\/commerce\/product\/\d+(?:\/|$)/);
151
- 459 | await expect(page.getByRole('heading', { name: 'Wireless Headphones' })).toBeVisible();
152
- 460 | await expect(page.getByText('HPH-BLK')).toBeVisible();
153
- 461 | expect(pageErrors).toEqual([]);
154
- 462 | },
155
- 463 | );
156
- 464 |
157
- 465 | test(
158
- 466 | 'Commerce catalogue: localized Product navigation preserves locale',
159
- 467 | { tag: ['@web', '@flow'] },
160
- 468 | async ({ page, request }) => {
161
- 469 | const localizedPath = '/commerce/zh-cn';
162
- 470 | const response = await request.get(localizedPath);
163
- 471 | expect(response.ok()).toBeTruthy();
164
- 472 | const html = await response.text();
165
- 473 | expect(html.toLowerCase()).not.toContain('data-zova-hydrated');
166
- 474 | expect(html).toContain('商品目录');
167
- 475 | expect(html).toContain('当前价格和库存以结算时确认为准。');
168
- 476 |
169
- 477 | const pageErrors = collectPageErrors(page);
170
- 478 | const documentResponse = await page.goto(localizedPath, { waitUntil: 'load' });
171
- 479 | expect(documentResponse?.ok()).toBeTruthy();
172
- 480 | await expect(page).toHaveURL(/\/commerce\/zh-cn(?:\/|$)/);
173
- 481 | await expect(page.locator('html')).toHaveAttribute('data-zova-hydrated', 'commerce');
174
- 482 | await expect(page.getByRole('heading', { name: '商品目录' })).toBeVisible();
175
- 483 | await expect(page.getByText('当前价格和库存以结算时确认为准。')).toBeVisible();
176
- 484 | await expect(page.getByText('库存 24 件')).toBeVisible();
177
- 485 |
178
- 486 | const productLink = page.getByRole('link', { name: 'Wireless Headphones' });
179
- 487 | await expect(productLink).toHaveAttribute('href', /\/commerce\/zh-cn\/product\/\d+$/);
180
- 488 | const productPath = await productLink.getAttribute('href');
181
- 489 | const productResponse = await request.get(productPath!);
182
- 490 | expect(productResponse.ok()).toBeTruthy();
183
- 491 | expect((await productResponse.text()).toLowerCase()).not.toContain('data-zova-hydrated');
184
- 492 | await productLink.click();
185
- 493 | await expect(page).toHaveURL(/\/commerce\/zh-cn\/product\/\d+(?:\/|$)/);
186
- 494 | await expect(page.getByRole('heading', { name: 'Wireless Headphones' })).toBeVisible();
187
- 495 | await expect(page.getByText('HPH-BLK')).toBeVisible();
188
- 496 | await expect(page.getByText('库存 24 件')).toBeVisible();
189
- 497 | await expect(page.getByRole('link', { name: '购物车' })).toHaveAttribute(
190
- 498 | 'href',
191
- 499 | '/commerce/commerce/trade/cart',
192
- 500 | );
193
- 501 | expect(pageErrors).toEqual([]);
194
- 502 | },
195
- 503 | );
196
- 504 |
197
- 505 | test(
198
- 506 | 'Commerce Product: Cart badge keeps SSR initial render neutral',
199
- 507 | { tag: ['@web', '@cart'] },
200
- 508 | async ({ page, request }) => {
201
- 509 | const productPath = '/commerce/product/1';
202
- 510 | const productResponse = await request.get(productPath);
203
- 511 | expect(productResponse.ok()).toBeTruthy();
204
- 512 | const productHtml = await productResponse.text();
205
- 513 | expect(productHtml.toLowerCase()).not.toContain('data-zova-hydrated');
206
- 514 | expect(productHtml).toContain('>Cart<!----></a>');
207
- 515 |
208
- 516 | const pageErrors = collectPageErrors(page);
209
- 517 | const documentResponse = await page.goto(productPath, { waitUntil: 'load' });
210
- 518 | expect(documentResponse?.ok()).toBeTruthy();
211
- 519 | await expect(page.locator('html')).toHaveAttribute('data-zova-hydrated', 'commerce');
212
- 520 | await expect(page).toHaveURL(productPath);
213
- 521 | await expect(page.getByRole('heading', { name: 'Wireless Headphones' })).toBeVisible();
214
- 522 |
215
- 523 | const cartLink = page.locator('a[href="/commerce/commerce/trade/cart"]');
216
- 524 | await expect(cartLink).toHaveCount(1);
217
- 525 | await expect(cartLink.locator('.badge')).toHaveCount(0);
218
- 526 | expect(pageErrors).toEqual([]);
219
- 527 | },
220
- 528 | );
221
- 529 |
222
- 530 | test(
223
- 531 | 'Commerce Address: session SSR protects an anonymous document request',
224
- 532 | { tag: ['@web', '@cart'] },
225
- 533 | async ({ page, request }) => {
226
- ```
@@ -1,229 +0,0 @@
1
- # Instructions
2
-
3
- - Following Playwright test failed.
4
- - Explain why, be concise, respect Playwright best practices.
5
- - Provide a snippet of code with the fix, if possible.
6
-
7
- # Test info
8
-
9
- - Name: a-commerce.spec.ts >> Commerce theme: session cookie mirrors public local preference without hydration mismatch
10
- - Location: repo-e2e/specs/a-commerce.spec.ts:287:1
11
-
12
- # Error details
13
-
14
- ```
15
- Error: expect(received).toBe(expected) // Object.is equality
16
-
17
- Expected: "false"
18
- Received: null
19
-
20
- Call Log:
21
- - Timeout 5000ms exceeded while waiting on the predicate
22
- ```
23
-
24
- # Test source
25
-
26
- ```ts
27
- 214 | await expect(page.getByText('No addresses yet.')).toBeVisible();
28
- 215 | }
29
- 216 |
30
- 217 | test(
31
- 218 | 'ATP-SSR-01: anonymous Commerce HTML is public and hydration completes',
32
- 219 | { tag: ['@web', '@smoke'] },
33
- 220 | async ({ page, request }) => {
34
- 221 | const response = await request.get('/commerce');
35
- 222 | expect(response.ok()).toBeTruthy();
36
- 223 | expect(response.headers()['cache-control']).toBe('no-cache, no-store, must-revalidate');
37
- 224 | const html = await response.text();
38
- 225 | const normalizedHtml = html.toLowerCase();
39
- 226 | expect(normalizedHtml).not.toContain('data-zova-hydrated');
40
- 227 |
41
- 228 | for (const marker of privateMarkers) {
42
- 229 | expect(normalizedHtml).not.toContain(`"${marker}"`);
43
- 230 | }
44
- 231 |
45
- 232 | const pageErrors = collectPageErrors(page);
46
- 233 | const documentResponse = await page.goto('/commerce', { waitUntil: 'load' });
47
- 234 | expect(documentResponse?.ok()).toBeTruthy();
48
- 235 | await expect(page).toHaveURL(/\/commerce(?:\/|$)/);
49
- 236 | await expect(page.locator('html')).toHaveAttribute('data-zova-hydrated', 'commerce');
50
- 237 | await expect(page.getByRole('heading', { name: 'Commerce catalogue' })).toBeVisible();
51
- 238 | await expect(page.getByText('Dashboard')).toHaveCount(0);
52
- 239 | await expect(page.locator('body')).toBeVisible();
53
- 240 | await expect(page).not.toHaveTitle(/error/i);
54
- 241 | expect(pageErrors).toEqual([]);
55
- 242 | },
56
- 243 | );
57
- 244 |
58
- 245 | test(
59
- 246 | 'Commerce theme: public local preference mirrors session cookie without hydration mismatch',
60
- 247 | { tag: ['@web', '@ssr', '@theme'] },
61
- 248 | async ({ browser, request }, testInfo) => {
62
- 249 | const customer = await registerCustomer(request, testInfo);
63
- 250 | const context = await browser.newContext();
64
- 251 | await context.addInitScript(() => localStorage.setItem('themedark', 'true'));
65
- 252 | const page = await context.newPage();
66
- 253 | const pageErrors = collectPageErrors(page);
67
- 254 | const consoleErrors: string[] = [];
68
- 255 | page.on('console', message => {
69
- 256 | if (message.type() === 'error' || /hydration mismatch/i.test(message.text())) {
70
- 257 | consoleErrors.push(message.text());
71
- 258 | }
72
- 259 | });
73
- 260 | try {
74
- 261 | await page.goto('/commerce', { waitUntil: 'load' });
75
- 262 | await page.evaluate(() => localStorage.setItem('themedark', 'true'));
76
- 263 | await page.reload({ waitUntil: 'load' });
77
- 264 | await expect(page.locator('html')).toHaveAttribute('data-zova-hydrated', 'commerce');
78
- 265 | await expect(page.locator('body')).toHaveAttribute('data-theme', 'dark');
79
- 266 | expect((await context.cookies()).find(cookie => cookie.name === 'themedark')?.value).toBe(
80
- 267 | 'true',
81
- 268 | );
82
- 269 |
83
- 270 | await login(
84
- 271 | page,
85
- 272 | '/commerce/commerce/member/address',
86
- 273 | customer.username,
87
- 274 | customer.password,
88
- 275 | 'commerce',
89
- 276 | );
90
- 277 | await expect(page.locator('html')).toHaveAttribute('data-zova-hydrated', 'commerce');
91
- 278 | await expect(page.locator('body')).toHaveAttribute('data-theme', 'dark');
92
- 279 | expect(pageErrors).toEqual([]);
93
- 280 | expect(consoleErrors).toEqual([]);
94
- 281 | } finally {
95
- 282 | await context.close();
96
- 283 | }
97
- 284 | },
98
- 285 | );
99
- 286 |
100
- 287 | test(
101
- 288 | 'Commerce theme: session cookie mirrors public local preference without hydration mismatch',
102
- 289 | { tag: ['@web', '@ssr', '@theme'] },
103
- 290 | async ({ browser, request }, testInfo) => {
104
- 291 | const customer = await registerCustomer(request, testInfo);
105
- 292 | const context = await browser.newContext();
106
- 293 | const page = await context.newPage();
107
- 294 | const pageErrors = collectPageErrors(page);
108
- 295 | const consoleErrors = collectConsoleErrors(page);
109
- 296 | try {
110
- 297 | await login(
111
- 298 | page,
112
- 299 | '/commerce/commerce/member/address',
113
- 300 | customer.username,
114
- 301 | customer.password,
115
- 302 | 'commerce',
116
- 303 | );
117
- 304 | await context.addCookies([
118
- 305 | {
119
- 306 | name: 'themedark',
120
- 307 | value: 'false',
121
- 308 | url: new URL(page.url()).origin,
122
- 309 | },
123
- 310 | ]);
124
- 311 | await page.reload({ waitUntil: 'load' });
125
- 312 | await expect(page.locator('html')).toHaveAttribute('data-zova-hydrated', 'commerce');
126
- 313 | await expect(page.locator('body')).toHaveAttribute('data-theme', 'light');
127
- > 314 | await expect.poll(() => page.evaluate(() => localStorage.getItem('themedark'))).toBe('false');
128
- | ^ Error: expect(received).toBe(expected) // Object.is equality
129
- 315 | expect(pageErrors).toEqual([]);
130
- 316 | expect(consoleErrors).toEqual([]);
131
- 317 |
132
- 318 | const publicContext = await browser.newContext();
133
- 319 | await publicContext.addInitScript(() => localStorage.setItem('themedark', 'false'));
134
- 320 | const publicPage = await publicContext.newPage();
135
- 321 | const publicPageErrors = collectPageErrors(publicPage);
136
- 322 | const publicConsoleErrors = collectConsoleErrors(publicPage);
137
- 323 | try {
138
- 324 | await publicPage.goto('/commerce', { waitUntil: 'load' });
139
- 325 | await expect(publicPage.locator('html')).toHaveAttribute('data-zova-hydrated', 'commerce');
140
- 326 | await expect(publicPage.locator('body')).toHaveAttribute('data-theme', 'light');
141
- 327 | await expect
142
- 328 | .poll(() => publicPage.evaluate(() => localStorage.getItem('themedark')))
143
- 329 | .toBe('false');
144
- 330 | expect(
145
- 331 | (await publicContext.cookies()).find(cookie => cookie.name === 'themedark')?.value,
146
- 332 | ).toBe('false');
147
- 333 | expect(publicPageErrors).toEqual([]);
148
- 334 | expect(publicConsoleErrors).toEqual([]);
149
- 335 | } finally {
150
- 336 | await publicContext.close();
151
- 337 | }
152
- 338 | } finally {
153
- 339 | await context.close();
154
- 340 | }
155
- 341 | },
156
- 342 | );
157
- 343 |
158
- 344 | test(
159
- 345 | 'Commerce theme: public auto preference mirrors resolved media value without hydration mismatch',
160
- 346 | { tag: ['@web', '@ssr', '@theme'] },
161
- 347 | async ({ browser }) => {
162
- 348 | const context = await browser.newContext();
163
- 349 | await context.addInitScript(() => localStorage.setItem('themedark', JSON.stringify('auto')));
164
- 350 | const page = await context.newPage();
165
- 351 | await page.emulateMedia({ colorScheme: 'dark' });
166
- 352 | const pageErrors = collectPageErrors(page);
167
- 353 | const consoleErrors = collectConsoleErrors(page);
168
- 354 | try {
169
- 355 | await page.goto('/commerce', { waitUntil: 'load' });
170
- 356 | await expect(page.locator('html')).toHaveAttribute('data-zova-hydrated', 'commerce');
171
- 357 | await expect(page.locator('body')).toHaveAttribute('data-theme', 'dark');
172
- 358 | await expect
173
- 359 | .poll(() => page.evaluate(() => localStorage.getItem('themedark')))
174
- 360 | .toBe('"auto"');
175
- 361 | expect((await context.cookies()).find(cookie => cookie.name === 'themedark')?.value).toBe(
176
- 362 | 'true',
177
- 363 | );
178
- 364 | expect(pageErrors).toEqual([]);
179
- 365 | expect(consoleErrors).toEqual([]);
180
- 366 | } finally {
181
- 367 | await context.close();
182
- 368 | }
183
- 369 | },
184
- 370 | );
185
- 371 |
186
- 372 | test(
187
- 373 | 'Commerce public SSR: theme cookie does not change SSR HTML',
188
- 374 | { tag: ['@web', '@ssr', '@theme'] },
189
- 375 | async ({ request }) => {
190
- 376 | const responses = await Promise.all([
191
- 377 | request.get('/commerce'),
192
- 378 | request.get('/commerce', { headers: { Cookie: 'themedark=true' } }),
193
- 379 | request.get('/commerce', { headers: { Cookie: 'themedark=false' } }),
194
- 380 | ]);
195
- 381 | const html = await Promise.all(responses.map(response => response.text()));
196
- 382 | for (const [index, response] of responses.entries()) {
197
- 383 | expect(response.status(), `public response ${index}`).toBe(200);
198
- 384 | expect(response.headers()['cache-control'], `public response ${index}`).toBe(
199
- 385 | 'no-cache, no-store, must-revalidate',
200
- 386 | );
201
- 387 | expect(html[index].toLowerCase()).not.toContain('data-zova-hydrated');
202
- 388 | expect(html[index]).toContain('data-ssr-theme-dark-false="light"');
203
- 389 | expect(html[index]).toContain('data-ssr-theme-dark-true="dark"');
204
- 390 | expect(html[index]).not.toContain('ssr_cookie_themedark');
205
- 391 | expect(html[index]).toContain("window.matchMedia('(prefers-color-scheme: dark)')");
206
- 392 | expect(html[index]).not.toMatch(/<body[^>]*data-theme="(?:dark|light)"/);
207
- 393 | }
208
- 394 | },
209
- 395 | );
210
- 396 |
211
- 397 | test(
212
- 398 | 'Commerce session SSR: theme cookie selects raw server theme',
213
- 399 | { tag: ['@web', '@ssr', '@theme'] },
214
- 400 | async ({ browser, request }, testInfo) => {
215
- 401 | const customer = await registerCustomer(request, testInfo);
216
- 402 | const context = await browser.newContext();
217
- 403 | const page = await context.newPage();
218
- 404 | try {
219
- 405 | await login(
220
- 406 | page,
221
- 407 | '/commerce/commerce/member/address',
222
- 408 | customer.username,
223
- 409 | customer.password,
224
- 410 | 'commerce',
225
- 411 | );
226
- 412 | const origin = new URL(page.url()).origin;
227
- 413 | const authCookies = (await context.cookies()).filter(cookie => cookie.name !== 'themedark');
228
- 414 | const getSessionHtml = async (value: string) => {
229
- ```