@faststore/core 4.10.1-dev.0 → 4.10.1-dev.2
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/.turbo/turbo-generate.log +3 -3
- package/.turbo/turbo-test.log +135 -138
- package/CHANGELOG.md +12 -0
- package/package.json +6 -6
- package/src/pages/[slug]/p.tsx +7 -2
- package/src/server/content/service.ts +96 -30
- package/test/server/content/service.test.ts +280 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@4.10.
|
|
2
|
+
> @faststore/core@4.10.1-dev.1 generate /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> pnpm run gen-types && pnpm run cache-graphql
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @faststore/core@4.10.
|
|
6
|
+
> @faststore/core@4.10.1-dev.1 gen-types /home/runner/work/faststore/faststore/packages/core
|
|
7
7
|
> node ../cli/bin/run generate-types .
|
|
8
8
|
|
|
9
9
|
[33m[STARTED][39m Parse Configuration
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
[32m[COMPLETED][39m Generate to @generated/
|
|
20
20
|
[32m[COMPLETED][39m Generate outputs
|
|
21
21
|
|
|
22
|
-
> @faststore/core@4.10.
|
|
22
|
+
> @faststore/core@4.10.1-dev.1 cache-graphql /home/runner/work/faststore/faststore/packages/core
|
|
23
23
|
> node ../cli/bin/run cache-graphql --config=./discovery.config.default.js --queries=./@generated/persisted-documents.json
|
|
24
24
|
|
|
25
25
|
[Info] - Config file location: /home/runner/work/faststore/faststore/packages/core/discovery.config.default.js
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@4.10.
|
|
2
|
+
> @faststore/core@4.10.1-dev.1 test /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> vitest run
|
|
4
4
|
|
|
5
5
|
|
|
@@ -7,26 +7,24 @@
|
|
|
7
7
|
|
|
8
8
|
Not implemented: navigation to another Document
|
|
9
9
|
Not implemented: navigation to another Document
|
|
10
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/ui/useScrollRestoration.browser.test.ts [2m([22m[2m43 tests[22m[2m)[22m[33m 1018[2mms[22m[39m
|
|
11
10
|
Browserslist: browsers data (caniuse-lite) is 8 months old. Please run:
|
|
12
11
|
npx update-browserslist-db@latest
|
|
13
12
|
Why you should do it regularly: https://github.com/browserslist/update-db#readme
|
|
14
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
15
|
-
|
|
16
|
-
[33m[2m✓[22m[39m
|
|
17
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/
|
|
18
|
-
[33m[2m✓[22m[39m shows
|
|
19
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/BuyingPolicyAlert.browser.test.tsx [2m([22m[2m13 tests[22m[2m)[22m[33m
|
|
20
|
-
[33m[2m✓[22m[39m opens the reject confirmation modal with the default English copy [33m
|
|
21
|
-
|
|
22
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
26
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
27
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
28
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
29
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/recommendations/useRecommendationShelf.browser.test.tsx [2m([22m[2m12 tests[22m[2m)[22m[32m 44[2mms[22m[39m
|
|
13
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/ui/useScrollRestoration.browser.test.ts [2m([22m[2m43 tests[22m[2m)[22m[33m 1047[2mms[22m[39m
|
|
14
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/ContractSwitcher.browser.test.tsx [2m([22m[2m22 tests[22m[2m)[22m[33m 2181[2mms[22m[39m
|
|
15
|
+
[33m[2m✓[22m[39m shows an error state when the list fails to load [33m 468[2mms[22m[39m
|
|
16
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/cards/MyAccountListCards.browser.test.tsx [2m([22m[2m16 tests[22m[2m)[22m[33m 1688[2mms[22m[39m
|
|
17
|
+
[33m[2m✓[22m[39m shows the tab bar and renders Personal cards by default [33m 704[2mms[22m[39m
|
|
18
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/BuyingPolicyAlert.browser.test.tsx [2m([22m[2m13 tests[22m[2m)[22m[33m 1744[2mms[22m[39m
|
|
19
|
+
[33m[2m✓[22m[39m opens the reject confirmation modal with the default English copy [33m 762[2mms[22m[39m
|
|
20
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/ui/RichText/RichText.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 254[2mms[22m[39m
|
|
21
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawer.browser.test.tsx [2m([22m[2m10 tests[22m[2m)[22m[33m 1201[2mms[22m[39m
|
|
22
|
+
[33m[2m✓[22m[39m renders the menu view with contract details and manage footer [33m 597[2mms[22m[39m
|
|
23
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/localization/useBindingSelector.browser.test.tsx [2m([22m[2m9 tests[22m[2m)[22m[32m 60[2mms[22m[39m
|
|
24
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/reconcileSessionLocale.browser.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 11[2mms[22m[39m
|
|
25
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/CartRecommendationShelf/CartRecommendationShelf.browser.test.tsx [2m([22m[2m13 tests[22m[2m)[22m[32m 143[2mms[22m[39m
|
|
26
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 49[2mms[22m[39m
|
|
27
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/recommendations/useRecommendationShelf.browser.test.tsx [2m([22m[2m12 tests[22m[2m)[22m[32m 45[2mms[22m[39m
|
|
30
28
|
[90mstderr[2m | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx
|
|
31
29
|
[22m[39mError in optimistic validation: TypeError: Failed to parse URL from /api/graphql?operationName=ValidateCartMutation&operationHash=3c71b0d3fc2bade14df68abfa271858beb361b12
|
|
32
30
|
[90m at node:internal/deps/undici/undici:16416:13[39m
|
|
@@ -56,10 +54,10 @@ Browserslist: browsers data (caniuse-lite) is 8 months old. Please run:
|
|
|
56
54
|
[90mstderr[2m | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx[2m > [22m[2mRecommendationShelf[2m > [22m[2mrenders nothing when there is an error
|
|
57
55
|
[22m[39mError fetching recommendations [90mundefined[39m boom for campaign vrn:recommendations:acc:rec-top-items-v2:campaign-1
|
|
58
56
|
|
|
59
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
60
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/CartSidebar/CartSidebar.browser.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
61
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/getInitialSession.browser.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m
|
|
62
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountOrderDetails.browser.test.tsx [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
57
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 71[2mms[22m[39m
|
|
58
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/CartSidebar/CartSidebar.browser.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[32m 71[2mms[22m[39m
|
|
59
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/getInitialSession.browser.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 11[2mms[22m[39m
|
|
60
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountOrderDetails.browser.test.tsx [2m([22m[2m4 tests[22m[2m)[22m[32m 75[2mms[22m[39m
|
|
63
61
|
[90mstderr[2m | test/pages/password-protection.browser.test.tsx[2m > [22m[2mPasswordProtectionLogin[2m > [22m[2mposts the password and redirects to the requested return path
|
|
64
62
|
[22m[39mWarning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
|
|
65
63
|
|
|
@@ -97,7 +95,6 @@ act(() => {
|
|
|
97
95
|
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
|
|
98
96
|
at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
|
|
99
97
|
|
|
100
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/navigation/Navbar.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 44[2mms[22m[39m
|
|
101
98
|
[90mstderr[2m | test/pages/password-protection.browser.test.tsx[2m > [22m[2mPasswordProtectionLogin[2m > [22m[2mdefaults returnTo to root and shows API validation errors
|
|
102
99
|
[22m[39mWarning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
|
|
103
100
|
|
|
@@ -242,6 +239,7 @@ act(() => {
|
|
|
242
239
|
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
|
|
243
240
|
at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
|
|
244
241
|
|
|
242
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/navigation/Navbar.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 28[2mms[22m[39m
|
|
245
243
|
[90mstderr[2m | test/pages/password-protection.browser.test.tsx[2m > [22m[2mPasswordProtectionLogin[2m > [22m[2mshows service unavailable when the login request fails
|
|
246
244
|
[22m[39mWarning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
|
|
247
245
|
|
|
@@ -290,10 +288,9 @@ act(() => {
|
|
|
290
288
|
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
|
|
291
289
|
at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
|
|
292
290
|
|
|
293
|
-
[32m✓[39m [30m[46m browser [49m[39m test/pages/password-protection.browser.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[33m
|
|
294
|
-
|
|
295
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
296
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/useSwitchContract.browser.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 33[2mms[22m[39m
|
|
291
|
+
[32m✓[39m [30m[46m browser [49m[39m test/pages/password-protection.browser.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[33m 451[2mms[22m[39m
|
|
292
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawerFooter.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[33m 347[2mms[22m[39m
|
|
293
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/useSwitchContract.browser.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 27[2mms[22m[39m
|
|
297
294
|
[90mstderr[2m | test/components/cms/RenderSections.browser.test.tsx
|
|
298
295
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
299
296
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -302,8 +299,8 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
302
299
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
|
|
303
300
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
304
301
|
|
|
305
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/navigation/NavbarSlider.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
306
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/cms/RenderSections.browser.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
302
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/navigation/NavbarSlider.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 24[2mms[22m[39m
|
|
303
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/cms/RenderSections.browser.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[32m 52[2mms[22m[39m
|
|
307
304
|
[90mstderr[2m | test/sdk/localization/store-url.browser.test.ts
|
|
308
305
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
309
306
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -312,15 +309,15 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
312
309
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
|
|
313
310
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
314
311
|
|
|
315
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/localization/store-url.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
316
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/Menu.browser.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
317
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/useAvailableContracts.browser.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
318
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/templates/SearchPage/SearchWrapper.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
319
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/recommendations/useRecommendationShelf.sessionFallback.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
320
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountListQuotes.browser.test.tsx [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
321
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/navigation/NavbarAccountArea.browser.test.tsx [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
322
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
323
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
312
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/localization/store-url.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
313
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/Menu.browser.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m 207[2mms[22m[39m
|
|
314
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/useAvailableContracts.browser.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 31[2mms[22m[39m
|
|
315
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/templates/SearchPage/SearchWrapper.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 17[2mms[22m[39m
|
|
316
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/recommendations/useRecommendationShelf.sessionFallback.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 120[2mms[22m[39m
|
|
317
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountListQuotes.browser.test.tsx [2m([22m[2m4 tests[22m[2m)[22m[32m 85[2mms[22m[39m
|
|
318
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/navigation/NavbarAccountArea.browser.test.tsx [2m([22m[2m4 tests[22m[2m)[22m[32m 31[2mms[22m[39m
|
|
319
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/CartRecommendationShelf/CartRecommendationProductCard.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 30[2mms[22m[39m
|
|
320
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/changeContractToken.browser.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
324
321
|
[90mstderr[2m | test/components/account/doLogout.browser.test.ts
|
|
325
322
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
326
323
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -329,9 +326,9 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
329
326
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
|
|
330
327
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
331
328
|
|
|
332
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/doLogout.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
333
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/
|
|
334
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/
|
|
329
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/doLogout.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
330
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawerHeader.browser.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[32m 177[2mms[22m[39m
|
|
331
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/ui/LocalizationButton.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 26[2mms[22m[39m
|
|
335
332
|
[90mstderr[2m | test/sdk/account/clearPersistedSessionState.browser.test.ts
|
|
336
333
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
337
334
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -341,13 +338,13 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
341
338
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
342
339
|
|
|
343
340
|
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/clearPersistedSessionState.browser.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 11[2mms[22m[39m
|
|
344
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountOrderDelivery.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
345
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/DeliveryOptionAccordion.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
346
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountOrderStatus.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
347
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/region/useRegion.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
348
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountListCards.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
349
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountOrdersList.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
350
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/SummaryCard.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
341
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountOrderDelivery.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 48[2mms[22m[39m
|
|
342
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/DeliveryOptionAccordion.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 57[2mms[22m[39m
|
|
343
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountOrderStatus.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 68[2mms[22m[39m
|
|
344
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/region/useRegion.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
345
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountListCards.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 53[2mms[22m[39m
|
|
346
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountOrdersList.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 23[2mms[22m[39m
|
|
347
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/SummaryCard.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 50[2mms[22m[39m
|
|
351
348
|
[90mstderr[2m | test/sdk/session/sessionStore.browser.test.ts
|
|
352
349
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
353
350
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -356,9 +353,9 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
356
353
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
|
|
357
354
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
358
355
|
|
|
359
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
360
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
361
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/DeliveryOptionAccordionDeliveryInfo.browser.test.tsx [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
356
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/sessionStore.browser.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
357
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationSignInButton.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 147[2mms[22m[39m
|
|
358
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/DeliveryOptionAccordionDeliveryInfo.browser.test.tsx [2m([22m[2m1 test[22m[2m)[22m[32m 22[2mms[22m[39m
|
|
362
359
|
[90mstderr[2m | test/sdk/session/validateSession.browser.test.ts
|
|
363
360
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
364
361
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -368,12 +365,13 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
368
365
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
369
366
|
|
|
370
367
|
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/validateSession.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
371
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/StatusCard.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
372
|
-
[32m✓[39m [30m[46m browser [49m[39m test/utils/isLocalHost.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
368
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/StatusCard.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 69[2mms[22m[39m
|
|
369
|
+
[32m✓[39m [30m[46m browser [49m[39m test/utils/isLocalHost.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
373
370
|
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/reconcileSessionLocale.disabled.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
374
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/DeliveryCard.browser.test.tsx [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
375
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/DeliveryOptionAccordionProducts.browser.test.tsx [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
376
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/skeletons/ProductGridSkeleton.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
371
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/DeliveryCard.browser.test.tsx [2m([22m[2m1 test[22m[2m)[22m[32m 32[2mms[22m[39m
|
|
372
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/DeliveryOptionAccordionProducts.browser.test.tsx [2m([22m[2m1 test[22m[2m)[22m[32m 19[2mms[22m[39m
|
|
373
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/skeletons/ProductGridSkeleton.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 17[2mms[22m[39m
|
|
374
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/localization/bindingPaths.test.ts [2m([22m[2m71 tests[22m[2m)[22m[32m 11[2mms[22m[39m
|
|
377
375
|
[90mstderr[2m | test/sdk/account/refreshToken.browser.test.ts
|
|
378
376
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
379
377
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -382,12 +380,13 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
382
380
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
|
|
383
381
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
384
382
|
|
|
385
|
-
[32m✓[39m [30m[
|
|
386
|
-
[32m✓[39m [30m[
|
|
387
|
-
[32m✓[39m [30m[
|
|
388
|
-
[32m✓[39m [30m[43m node [49m[39m test/pages/api/switch-contract.test.ts [2m([22m[2m25 tests[22m[2m)[22m[32m
|
|
389
|
-
[32m✓[39m [30m[
|
|
390
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/match-url.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m
|
|
383
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/refreshToken.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
384
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/password-protection-service.test.ts [2m([22m[2m22 tests[22m[2m)[22m[32m 19[2mms[22m[39m
|
|
385
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/orders/FilterFacetPendingApproval.browser.test.tsx [2m([22m[2m1 test[22m[2m)[22m[32m 143[2mms[22m[39m
|
|
386
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/switch-contract.test.ts [2m([22m[2m25 tests[22m[2m)[22m[32m 66[2mms[22m[39m
|
|
387
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/content/service.test.ts [2m([22m[2m16 tests[22m[2m)[22m[32m 15[2mms[22m[39m
|
|
388
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/match-url.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
389
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/useBindingSelector.test.tsx [2m([22m[2m22 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
391
390
|
[90mstderr[2m | test/sdk/deliveryPromise/provider.effect.test.tsx[2m > [22m[2mDeliveryPromiseProvider pickup fetch[2m > [22m[2mclears the loading flag after a failed request and retries on the next update
|
|
392
391
|
[22m[39mFailed to fetch pickup points: Error: network
|
|
393
392
|
at [90m/home/runner/work/faststore/faststore/packages/core/[39mtest/sdk/deliveryPromise/provider.effect.test.tsx:250:30
|
|
@@ -414,13 +413,13 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
414
413
|
at trace (file:///home/runner/work/faststore/faststore/node_modules/[4m.pnpm[24m/vitest@4.0.18_@opentelemetry+api@1.9.0_@types+node@20.19.13_jiti@2.6.1_jsdom@27.4.0_sas_13be941c57d55f08f06eeaf1c180ddfe/node_modules/[4mvitest[24m/dist/chunks/test.B8ej_ZHS.js:239:21)
|
|
415
414
|
at runTest (file:///home/runner/work/faststore/faststore/node_modules/[4m.pnpm[24m/@vitest+runner@4.0.18/node_modules/[4m@vitest/runner[24m/dist/index.js:1653:12)
|
|
416
415
|
|
|
417
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/deliveryPromise/provider.effect.test.tsx [2m([22m[2m9 tests[22m[2m)[22m[32m
|
|
418
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
419
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
416
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/deliveryPromise/provider.effect.test.tsx [2m([22m[2m9 tests[22m[2m)[22m[32m 57[2mms[22m[39m
|
|
417
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/unlock.test.ts [2m([22m[2m15 tests[22m[2m)[22m[32m 92[2mms[22m[39m
|
|
418
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/session/syncSalesChannelFromOrderForm.test.ts [2m([22m[2m14 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
419
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/bindingSelector.test.ts [2m([22m[2m18 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
420
420
|
[90mstderr[2m | test/components/search/SearchInputComponent.test.tsx
|
|
421
421
|
[22m[39mWarning: forwardRef render functions accept exactly two parameters: props and ref. Did you forget to use the ref parameter?
|
|
422
422
|
|
|
423
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/session/syncSalesChannelFromOrderForm.test.ts [2m([22m[2m14 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
424
423
|
[90mstderr[2m | test/components/search/SearchInputComponent.test.tsx[2m > [22m[2mSearchInput (OES integration)[2m > [22m[2mrenders without crashing
|
|
425
424
|
[22m[39mWarning: React does not recognize the `visibleDropdown` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `visibledropdown` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
|
|
426
425
|
at div
|
|
@@ -481,24 +480,23 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
|
|
|
481
480
|
at Suspense
|
|
482
481
|
at Wrapper (/home/runner/work/faststore/faststore/packages/core/test/components/search/SearchInputComponent.test.tsx:106:20)
|
|
483
482
|
|
|
484
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchInputComponent.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
485
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
486
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
487
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/search/useSearchHistory.test.ts [2m([22m[2m13 tests[22m[2m)[22m[32m 32[2mms[22m[39m
|
|
483
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchInputComponent.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m 42[2mms[22m[39m
|
|
484
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountListQuotesTable.test.tsx [2m([22m[2m15 tests[22m[2m)[22m[32m 281[2mms[22m[39m
|
|
485
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/search/useSearchHistory.test.ts [2m([22m[2m13 tests[22m[2m)[22m[32m 28[2mms[22m[39m
|
|
488
486
|
[90mstderr[2m | test/pages/pvt/account/cards/index.test.ts[2m > [22m[2mCards page getServerSideProps[2m > [22m[2mredirects to /pvt/account/403 when the query fails with 401/403
|
|
489
487
|
[22m[39m{ extensions: { status: [33m401[39m } }
|
|
490
488
|
|
|
491
489
|
[90mstderr[2m | test/pages/pvt/account/cards/index.test.ts[2m > [22m[2mCards page getServerSideProps[2m > [22m[2mrenders the error state (no redirect) when the query fails with a non-auth status
|
|
492
490
|
[22m[39m{ extensions: { status: [33m502[39m } }
|
|
493
491
|
|
|
494
|
-
[32m✓[39m [30m[43m node [49m[39m test/pages/pvt/account/cards/index.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
495
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
496
|
-
|
|
497
|
-
[33m[2m✓[22m[39m navigates
|
|
498
|
-
|
|
499
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
500
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/
|
|
501
|
-
[32m✓[39m [30m[43m node [49m[39m test/experimental/myAccountCmsServerSideProps.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
492
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/pvt/account/cards/index.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
493
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/cookieCacheBusting.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
494
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountListQuotes.test.tsx [2m([22m[2m11 tests[22m[2m)[22m[33m 783[2mms[22m[39m
|
|
495
|
+
[33m[2m✓[22m[39m navigates with the search term on blur [33m 357[2mms[22m[39m
|
|
496
|
+
[33m[2m✓[22m[39m navigates without a label param when the search is cleared [33m 358[2mms[22m[39m
|
|
497
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/quoteFilters.test.ts [2m([22m[2m26 tests[22m[2m)[22m[32m 20[2mms[22m[39m
|
|
498
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/productJsonLd.test.ts [2m([22m[2m36 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
499
|
+
[32m✓[39m [30m[43m node [49m[39m test/experimental/myAccountCmsServerSideProps.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
502
500
|
[90mstderr[2m | test/pages/api/graphql.test.ts[2m > [22m[2m/api/graphql error status propagation[2m > [22m[2mpropagates the upstream 400 from a wrapped BadRequestError instead of 500
|
|
503
501
|
[22m[39mGraphql execution returned with error: [
|
|
504
502
|
{
|
|
@@ -608,77 +606,76 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
|
|
|
608
606
|
at trace (file:///home/runner/work/faststore/faststore/node_modules/[4m.pnpm[24m/vitest@4.0.18_@opentelemetry+api@1.9.0_@types+node@20.19.13_jiti@2.6.1_jsdom@27.4.0_sas_13be941c57d55f08f06eeaf1c180ddfe/node_modules/[4mvitest[24m/dist/chunks/test.B8ej_ZHS.js:239:21)
|
|
609
607
|
at runTest (file:///home/runner/work/faststore/faststore/node_modules/[4m.pnpm[24m/@vitest+runner@4.0.18/node_modules/[4m@vitest/runner[24m/dist/index.js:1653:12)
|
|
610
608
|
|
|
611
|
-
[32m✓[39m [30m[43m node [49m[39m test/pages/api/graphql.test.ts [2m([22m[2m19 tests[22m[2m)[22m[32m
|
|
612
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/clearCookies.test.ts [2m([22m[2m20 tests[22m[2m)[22m[32m
|
|
609
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/graphql.test.ts [2m([22m[2m19 tests[22m[2m)[22m[32m 20[2mms[22m[39m
|
|
610
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/clearCookies.test.ts [2m([22m[2m20 tests[22m[2m)[22m[32m 16[2mms[22m[39m
|
|
613
611
|
[32m✓[39m [30m[43m node [49m[39m test/utils/multipleTemplates.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
614
612
|
[90mstderr[2m | test/sdk/account/useSetPassword.test.ts[2m > [22m[2museSetPassword[2m > [22m[2mmaps wrongcredentials error responses to the existing message
|
|
615
613
|
[22m[39mSet password request failed: Bad Request
|
|
616
614
|
|
|
617
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/useSetPassword.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
618
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntryOperation.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
619
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/localization/localizeRedirectDestination.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m
|
|
620
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesFilterSlider.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
621
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesStatusSelector.test.tsx [2m([22m[2m14 tests[22m[2m)[22m[32m
|
|
622
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/localization/hreflang.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
615
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/useSetPassword.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 36[2mms[22m[39m
|
|
616
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntryOperation.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 26[2mms[22m[39m
|
|
617
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/localization/localizeRedirectDestination.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
618
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesFilterSlider.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 91[2mms[22m[39m
|
|
619
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesStatusSelector.test.tsx [2m([22m[2m14 tests[22m[2m)[22m[32m 111[2mms[22m[39m
|
|
620
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/localization/hreflang.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
623
621
|
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/getMyAccountRoutes.test.ts [2m([22m[2m13 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
624
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesSelectedTags.test.tsx [2m([22m[2m10 tests[22m[2m)[22m[32m
|
|
625
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/redirects/index.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m
|
|
626
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntryUpload.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
627
|
-
[32m✓[39m [30m[43m node [49m[39m test/proxy.localization.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
628
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntry.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
629
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/account/orders/getDeliveryOptionLabel.test.ts [2m([22m[2m21 tests[22m[2m)[22m[32m
|
|
630
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/graphql/retryPolicy.test.ts [2m([22m[2m18 tests[22m[2m)[22m[32m
|
|
631
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/cms/myAccountDefaultSections.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m
|
|
632
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/productJsonLdRendering.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
633
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/trustedForwardedHost.test.ts [2m([22m[2m27 tests[22m[2m)[22m[32m
|
|
634
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/analytics/useStartRecommendationSession.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
635
|
-
[32m✓[39m [30m[43m node [49m[39m test/proxy.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
636
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
637
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
622
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesSelectedTags.test.tsx [2m([22m[2m10 tests[22m[2m)[22m[32m 66[2mms[22m[39m
|
|
623
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/redirects/index.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 43[2mms[22m[39m
|
|
624
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntryUpload.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 28[2mms[22m[39m
|
|
625
|
+
[32m✓[39m [30m[43m node [49m[39m test/proxy.localization.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 32[2mms[22m[39m
|
|
626
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntry.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 23[2mms[22m[39m
|
|
627
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/account/orders/getDeliveryOptionLabel.test.ts [2m([22m[2m21 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
628
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/graphql/retryPolicy.test.ts [2m([22m[2m18 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
629
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/cms/myAccountDefaultSections.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
630
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/productJsonLdRendering.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
631
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/trustedForwardedHost.test.ts [2m([22m[2m27 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
632
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/analytics/useStartRecommendationSession.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 23[2mms[22m[39m
|
|
633
|
+
[32m✓[39m [30m[43m node [49m[39m test/proxy.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 11[2mms[22m[39m
|
|
634
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/webops-api.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
635
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderFormItems.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 18[2mms[22m[39m
|
|
636
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/account/orders/StatusCard.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
637
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/index.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 1131[2mms[22m[39m
|
|
638
|
+
[33m[2m✓[22m[39m should handle options and execute [33m 791[2mms[22m[39m
|
|
638
639
|
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/store-url.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
639
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
640
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/
|
|
641
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/cart/waitForSessionValidated.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
642
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/content/service.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
643
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/index.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 1839[2mms[22m[39m
|
|
644
|
-
[33m[2m✓[22m[39m should handle options and execute [33m 1416[2mms[22m[39m
|
|
640
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/deliveryPromise/queries.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
641
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/cart/waitForSessionValidated.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
645
642
|
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/refreshToken.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
646
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/cms/global.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
647
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/deliveryPromise/provider.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m
|
|
648
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/auth/useAuth.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
649
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/getRequestHostname.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m
|
|
650
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/account/Layout.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
651
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
652
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
653
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchInput.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
654
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/validateSessionRefreshToken.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
655
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/vrn.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
656
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/cms/index.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
657
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
658
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
659
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/getB2BSessionClaims.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
660
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/userOrderStatus.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
661
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/useRecommendationUserId.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
643
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/cms/global.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
644
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/deliveryPromise/provider.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
645
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/auth/useAuth.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
646
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/getRequestHostname.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
647
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/account/Layout.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m 44[2mms[22m[39m
|
|
648
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/preview.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
649
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/rootSpan.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 24[2mms[22m[39m
|
|
650
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchInput.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
651
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/validateSessionRefreshToken.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
652
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/vrn.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
653
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/cms/index.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
654
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/region/useRegion.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
655
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/retry.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
656
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/getB2BSessionClaims.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
657
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/userOrderStatus.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
658
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/useRecommendationUserId.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 178[2mms[22m[39m
|
|
662
659
|
[32m✓[39m [30m[43m node [49m[39m test/utils/unlockResponse.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
663
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/useRecommendations.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
664
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/account/OrganizationDrawerBody.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
665
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/deliveryPromise/reducer.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
666
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/isLocalHost.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m
|
|
667
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuoteStatusBadge.test.tsx [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
668
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/session/toSessionInput.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
669
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/account/orders/getOrderTotalLabel.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
660
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/useRecommendations.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
661
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/account/OrganizationDrawerBody.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 31[2mms[22m[39m
|
|
662
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/deliveryPromise/reducer.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
663
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/isLocalHost.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
664
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuoteStatusBadge.test.tsx [2m([22m[2m4 tests[22m[2m)[22m[32m 19[2mms[22m[39m
|
|
665
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/session/toSessionInput.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
666
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/account/orders/getOrderTotalLabel.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
670
667
|
[32m✓[39m [30m[43m node [49m[39m test/components/account/orders/listOrdersLabels.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
671
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/getCookie.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
672
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/auth/ProfileChallenge.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
673
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/session/isSignInAreaResolved.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
674
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/filterChannel.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
668
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/getCookie.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
669
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/auth/ProfileChallenge.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 19[2mms[22m[39m
|
|
670
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/session/isSignInAreaResolved.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
671
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/filterChannel.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
675
672
|
[32m✓[39m [30m[43m node [49m[39m test/sdk/analytics/utils.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
676
|
-
[32m✓[39m [30m[43m node [49m[39m test/instrumentation.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
677
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/account/orders/orderDetailsLabels.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
673
|
+
[32m✓[39m [30m[43m node [49m[39m test/instrumentation.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
674
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/account/orders/orderDetailsLabels.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
678
675
|
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/clearPersistedSessionState.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
679
676
|
|
|
680
677
|
[2m Test Files [22m [1m[32m135 passed[39m[22m[90m (135)[39m
|
|
681
|
-
[2m Tests [22m [1m[
|
|
682
|
-
[2m Start at [22m
|
|
683
|
-
[2m Duration [22m
|
|
678
|
+
[2m Tests [22m [1m[32m1077 passed[39m[22m[90m (1077)[39m
|
|
679
|
+
[2m Start at [22m 19:24:01
|
|
680
|
+
[2m Duration [22m 37.79s[2m (transform 8.93s, setup 0ms, import 32.76s, tests 14.78s, environment 45.53s)[22m
|
|
684
681
|
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.10.1-dev.2](https://github.com/vtex/faststore/compare/v4.10.1-dev.1...v4.10.1-dev.2) (2026-10-27)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **core:** keep CMS author emails off public page props ([a63c6b1](https://github.com/vtex/faststore/commit/a63c6b1b880055a9ceb6395ad3bba04ad2ce4a95))
|
|
11
|
+
|
|
12
|
+
## [4.10.1-dev.1](https://github.com/vtex/faststore/compare/v4.10.1-dev.0...v4.10.1-dev.1) (2026-10-21)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- **core:** cache Content Platform template list across page generations ([#3526](https://github.com/vtex/faststore/issues/3526)) ([b03ed33](https://github.com/vtex/faststore/commit/b03ed332bd8c4ea5ef4bb834b8590728946852e5)), closes [#3384](https://github.com/vtex/faststore/issues/3384) [#3384](https://github.com/vtex/faststore/issues/3384)
|
|
17
|
+
|
|
6
18
|
## [4.10.1-dev.0](https://github.com/vtex/faststore/compare/v4.10.0...v4.10.1-dev.0) (2026-10-15)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @faststore/core
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "4.10.1-dev.
|
|
3
|
+
"version": "4.10.1-dev.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -71,11 +71,11 @@
|
|
|
71
71
|
"style-loader": "^3.3.1",
|
|
72
72
|
"swr": "^2.2.5",
|
|
73
73
|
"use-sync-external-store": "^1.6.0",
|
|
74
|
-
"@faststore/api": "4.10.1-dev.
|
|
75
|
-
"@faststore/diagnostics": "4.10.1-dev.
|
|
76
|
-
"@faststore/
|
|
77
|
-
"@faststore/
|
|
78
|
-
"@faststore/
|
|
74
|
+
"@faststore/api": "4.10.1-dev.2",
|
|
75
|
+
"@faststore/diagnostics": "4.10.1-dev.2",
|
|
76
|
+
"@faststore/ui": "4.10.1-dev.2",
|
|
77
|
+
"@faststore/lighthouse": "4.10.1-dev.2",
|
|
78
|
+
"@faststore/sdk": "4.10.1-dev.2"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@cypress/code-coverage": "^3.12.1",
|
package/src/pages/[slug]/p.tsx
CHANGED
|
@@ -85,14 +85,18 @@ const OG_PRODUCT_CONDITION_BY_SCHEMA: Record<string, string> = {
|
|
|
85
85
|
'https://schema.org/UsedCondition': 'used',
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
type Props =
|
|
88
|
+
type Props = {
|
|
89
|
+
sections: PDPContentType['sections']
|
|
90
|
+
settings: PDPContentType['settings']
|
|
89
91
|
data: ServerProductQueryQuery
|
|
90
92
|
globalSections: GlobalSectionsData
|
|
93
|
+
offers: ReturnType<typeof toProductJsonLdOffer>
|
|
91
94
|
meta: {
|
|
92
95
|
title: string
|
|
93
96
|
description: string
|
|
94
97
|
canonical: string
|
|
95
98
|
}
|
|
99
|
+
key: string
|
|
96
100
|
}
|
|
97
101
|
|
|
98
102
|
// Array merging strategy from deepmerge that makes client arrays overwrite server array
|
|
@@ -500,7 +504,8 @@ export const getStaticProps: GetStaticProps<
|
|
|
500
504
|
return {
|
|
501
505
|
props: {
|
|
502
506
|
data,
|
|
503
|
-
|
|
507
|
+
sections: cmsPage.sections,
|
|
508
|
+
settings: cmsPage.settings,
|
|
504
509
|
meta,
|
|
505
510
|
offers,
|
|
506
511
|
globalSections: globalSectionsResult,
|
|
@@ -17,17 +17,31 @@ import { getPLP, type PLPContentType } from '../cms/plp'
|
|
|
17
17
|
import type { ContentOptions, ContentParams } from './types'
|
|
18
18
|
import { isBranchPreview, isContentPlatformSource } from './utils'
|
|
19
19
|
|
|
20
|
-
type ContentResult = ContentData |
|
|
20
|
+
type ContentResult = ContentData | PageContentType
|
|
21
|
+
|
|
22
|
+
const CONTENT_AUTHOR_FIELDS = ['createdBy', 'updatedBy'] as const
|
|
23
|
+
|
|
24
|
+
type ContentListCacheEntry = {
|
|
25
|
+
expiresAt: number
|
|
26
|
+
promise: Promise<{ data: ContentResult[] }>
|
|
27
|
+
}
|
|
21
28
|
|
|
22
29
|
const OPTIONAL_CONTENT_TYPES = [
|
|
23
30
|
'globalHeaderSections',
|
|
24
31
|
'globalFooterSections',
|
|
25
32
|
] as const
|
|
33
|
+
|
|
34
|
+
// Bounds how stale the template list can get in long-lived processes (ISR);
|
|
35
|
+
// a CMS publish already triggers a new build.
|
|
36
|
+
const CONTENT_LIST_CACHE_TTL_MS = 5 * 60 * 1000
|
|
37
|
+
|
|
26
38
|
export class ContentService {
|
|
27
39
|
private readonly clientCP = new ClientCP({
|
|
28
40
|
tenant: config.api.storeId,
|
|
29
41
|
})
|
|
30
42
|
|
|
43
|
+
private readonly contentListCache = new Map<string, ContentListCacheEntry>()
|
|
44
|
+
|
|
31
45
|
async getSingleContent<T extends ContentData>(
|
|
32
46
|
params: ContentParams
|
|
33
47
|
): Promise<T> {
|
|
@@ -46,29 +60,12 @@ export class ContentService {
|
|
|
46
60
|
|
|
47
61
|
if (isContentPlatformSource()) {
|
|
48
62
|
const serviceParams = this.convertOptionsToParams(options)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
let scroll: string | undefined
|
|
53
|
-
let pages = 0
|
|
54
|
-
|
|
55
|
-
do {
|
|
56
|
-
const result = await this.clientCP.listEntries(serviceParams, scroll)
|
|
57
|
-
allEntries.push(...result.entries)
|
|
58
|
-
const next = result.scroll ?? undefined
|
|
59
|
-
if (next && next === scroll) break
|
|
60
|
-
scroll = next
|
|
61
|
-
} while (scroll && ++pages < MAX_PAGES)
|
|
62
|
-
|
|
63
|
-
if (pages >= MAX_PAGES) {
|
|
64
|
-
console.warn('listEntries pagination hit MAX_PAGES cap', serviceParams)
|
|
63
|
+
|
|
64
|
+
if (options.isPreview) {
|
|
65
|
+
return this.listAndFillEntries(serviceParams, true)
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
return this.
|
|
68
|
-
allEntries,
|
|
69
|
-
serviceParams,
|
|
70
|
-
options.isPreview
|
|
71
|
-
)
|
|
68
|
+
return this.getCachedContentList(serviceParams)
|
|
72
69
|
}
|
|
73
70
|
return getCMSPage(options.cmsOptions)
|
|
74
71
|
}
|
|
@@ -136,11 +133,65 @@ export class ContentService {
|
|
|
136
133
|
}
|
|
137
134
|
}
|
|
138
135
|
|
|
136
|
+
private getCachedContentList(
|
|
137
|
+
serviceParams: EntryPathParams
|
|
138
|
+
): Promise<{ data: ContentResult[] }> {
|
|
139
|
+
// listEntries only depends on these fields; the page slug must stay out of the key.
|
|
140
|
+
const { accountName, storeId, contentType, locale } = serviceParams
|
|
141
|
+
const key = JSON.stringify([accountName, storeId, contentType, locale])
|
|
142
|
+
|
|
143
|
+
const cached = this.contentListCache.get(key)
|
|
144
|
+
if (cached && cached.expiresAt > Date.now()) {
|
|
145
|
+
return cached.promise
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const promise = this.listAndFillEntries(serviceParams, false).catch(
|
|
149
|
+
(err: unknown) => {
|
|
150
|
+
if (this.contentListCache.get(key)?.promise === promise) {
|
|
151
|
+
this.contentListCache.delete(key)
|
|
152
|
+
}
|
|
153
|
+
throw err
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
this.contentListCache.set(key, {
|
|
158
|
+
expiresAt: Date.now() + CONTENT_LIST_CACHE_TTL_MS,
|
|
159
|
+
promise,
|
|
160
|
+
})
|
|
161
|
+
|
|
162
|
+
return promise
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
private async listAndFillEntries(
|
|
166
|
+
serviceParams: EntryPathParams,
|
|
167
|
+
isPreview: boolean
|
|
168
|
+
): Promise<{ data: PageContentType[] }> {
|
|
169
|
+
// TODO: This should be temporary until the cp data-plane have a search engine.
|
|
170
|
+
const MAX_PAGES = 25
|
|
171
|
+
const allEntries: ContentEntry[] = []
|
|
172
|
+
let scroll: string | undefined
|
|
173
|
+
let pages = 0
|
|
174
|
+
|
|
175
|
+
do {
|
|
176
|
+
const result = await this.clientCP.listEntries(serviceParams, scroll)
|
|
177
|
+
allEntries.push(...result.entries)
|
|
178
|
+
const next = result.scroll ?? undefined
|
|
179
|
+
if (next && next === scroll) break
|
|
180
|
+
scroll = next
|
|
181
|
+
} while (scroll && ++pages < MAX_PAGES)
|
|
182
|
+
|
|
183
|
+
if (pages >= MAX_PAGES) {
|
|
184
|
+
console.warn('listEntries pagination hit MAX_PAGES cap', serviceParams)
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return this.fillEntriesWithData(allEntries, serviceParams, isPreview)
|
|
188
|
+
}
|
|
189
|
+
|
|
139
190
|
private async fillEntriesWithData(
|
|
140
191
|
entries: ContentEntry[],
|
|
141
192
|
serviceParams: EntryPathParams,
|
|
142
193
|
isPreview: boolean
|
|
143
|
-
): Promise<{ data:
|
|
194
|
+
): Promise<{ data: PageContentType[] }> {
|
|
144
195
|
const data = await Promise.all(
|
|
145
196
|
entries.map(async (entry) => {
|
|
146
197
|
const entryData = await this.getEntryData(
|
|
@@ -171,15 +222,21 @@ export class ContentService {
|
|
|
171
222
|
throw new Error(`${operation} requires entryId or slug`)
|
|
172
223
|
}
|
|
173
224
|
|
|
225
|
+
const entry = await this.loadEntry(params, isPreview)
|
|
226
|
+
|
|
227
|
+
return withoutContentAuthorMetadata(entry as PageContentType)
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
private loadEntry(params: EntryPathParams, isPreview: boolean) {
|
|
174
231
|
if (isPreview) {
|
|
175
232
|
return params.entryId
|
|
176
|
-
?
|
|
177
|
-
:
|
|
233
|
+
? this.clientCP.previewEntryById(params)
|
|
234
|
+
: this.clientCP.previewEntryBySlug(params)
|
|
178
235
|
}
|
|
179
236
|
|
|
180
237
|
return params.entryId
|
|
181
|
-
?
|
|
182
|
-
:
|
|
238
|
+
? this.clientCP.getEntry(params)
|
|
239
|
+
: this.clientCP.getEntryBySlug(params)
|
|
183
240
|
}
|
|
184
241
|
|
|
185
242
|
private async fetchFirstEntryFromList(
|
|
@@ -292,16 +349,25 @@ export class ContentService {
|
|
|
292
349
|
private mergeEntryWithData(
|
|
293
350
|
entry: ContentEntry,
|
|
294
351
|
data: PageContentType
|
|
295
|
-
):
|
|
352
|
+
): PageContentType {
|
|
296
353
|
return {
|
|
297
|
-
...
|
|
298
|
-
...data,
|
|
354
|
+
...withoutContentAuthorMetadata(data),
|
|
299
355
|
id: entry.id,
|
|
300
356
|
name: entry.name ?? '',
|
|
301
357
|
}
|
|
302
358
|
}
|
|
303
359
|
}
|
|
304
360
|
|
|
361
|
+
function withoutContentAuthorMetadata<T extends object>(value: T): T {
|
|
362
|
+
const content = { ...value } as Record<string, unknown>
|
|
363
|
+
|
|
364
|
+
for (const field of CONTENT_AUTHOR_FIELDS) {
|
|
365
|
+
delete content[field]
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
return content as T
|
|
369
|
+
}
|
|
370
|
+
|
|
305
371
|
function isNotFoundError(err: unknown): boolean {
|
|
306
372
|
if (err instanceof MissingContentError) return true
|
|
307
373
|
if (err instanceof Error && /\b404\b/.test(err.message)) return true
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
import type { EntryPathParams } from '@vtex/client-cp'
|
|
2
|
-
import { describe, expect, it } from 'vitest'
|
|
1
|
+
import type { ContentEntry, EntryPathParams } from '@vtex/client-cp'
|
|
2
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
|
3
3
|
|
|
4
4
|
import { ContentService } from '../../../src/server/content/service'
|
|
5
5
|
import type {
|
|
6
6
|
ContentOptions,
|
|
7
7
|
ContentParams,
|
|
8
8
|
} from '../../../src/server/content/types'
|
|
9
|
+
import type * as ContentUtils from '../../../src/server/content/utils'
|
|
10
|
+
import { isContentPlatformSource } from '../../../src/server/content/utils'
|
|
11
|
+
|
|
12
|
+
vi.mock('../../../src/server/content/utils', async (importOriginal) => {
|
|
13
|
+
const actual = await importOriginal<typeof ContentUtils>()
|
|
14
|
+
return {
|
|
15
|
+
...actual,
|
|
16
|
+
isContentPlatformSource: vi.fn(actual.isContentPlatformSource),
|
|
17
|
+
}
|
|
18
|
+
})
|
|
9
19
|
|
|
10
20
|
type ContentServiceInternals = {
|
|
11
21
|
createContentOptions: (params: ContentParams) => ContentOptions
|
|
@@ -15,6 +25,71 @@ type ContentServiceInternals = {
|
|
|
15
25
|
const getServiceInternals = (service: ContentService) =>
|
|
16
26
|
service as unknown as ContentServiceInternals
|
|
17
27
|
|
|
28
|
+
const NOT_FOUND = 'Request failed with status code 404'
|
|
29
|
+
|
|
30
|
+
const entryData: Record<string, Record<string, unknown>> = {
|
|
31
|
+
generic: { sections: [{ name: 'Generic' }] },
|
|
32
|
+
collection: {
|
|
33
|
+
settings: { template: { value: '/colecao' } },
|
|
34
|
+
sections: [{ name: 'Collection' }],
|
|
35
|
+
},
|
|
36
|
+
other: {
|
|
37
|
+
settings: { template: { value: '/outra' } },
|
|
38
|
+
sections: [{ name: 'Other' }],
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const toEntry = (id: string): ContentEntry => ({
|
|
43
|
+
id,
|
|
44
|
+
name: id,
|
|
45
|
+
account: 'example-account',
|
|
46
|
+
storeId: 'faststore',
|
|
47
|
+
createdAt: '2026-01-01T00:00:00.000Z',
|
|
48
|
+
updatedAt: '2026-01-02T00:00:00.000Z',
|
|
49
|
+
createdBy: 'editor@example.com',
|
|
50
|
+
updatedBy: 'other@example.com',
|
|
51
|
+
slug: id,
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
function createFakeClientCP(pages: string[][]) {
|
|
55
|
+
return {
|
|
56
|
+
listEntries: vi.fn(async (_params: EntryPathParams, scroll?: string) => {
|
|
57
|
+
const index = scroll ? Number(scroll) : 0
|
|
58
|
+
return {
|
|
59
|
+
entries: pages[index].map(toEntry),
|
|
60
|
+
scroll: index + 1 < pages.length ? String(index + 1) : null,
|
|
61
|
+
}
|
|
62
|
+
}),
|
|
63
|
+
getEntry: vi.fn(async ({ entryId }: EntryPathParams) => ({
|
|
64
|
+
...entryData[entryId as string],
|
|
65
|
+
createdBy: 'payload@example.com',
|
|
66
|
+
updatedBy: 'payload@example.com',
|
|
67
|
+
})),
|
|
68
|
+
previewEntryById: vi.fn(async ({ entryId }: EntryPathParams) => ({
|
|
69
|
+
...entryData[entryId as string],
|
|
70
|
+
})),
|
|
71
|
+
getEntryBySlug: vi.fn(
|
|
72
|
+
async (_params: EntryPathParams): Promise<Record<string, unknown>> => {
|
|
73
|
+
throw new Error(NOT_FOUND)
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
previewEntryBySlug: vi.fn(
|
|
77
|
+
async (_params: EntryPathParams): Promise<Record<string, unknown>> => {
|
|
78
|
+
throw new Error(NOT_FOUND)
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function createServiceWithClient(
|
|
85
|
+
pages: string[][] = [['generic', 'collection', 'other']]
|
|
86
|
+
) {
|
|
87
|
+
const service = new ContentService()
|
|
88
|
+
const clientCP = createFakeClientCP(pages)
|
|
89
|
+
Object.defineProperty(service, 'clientCP', { value: clientCP })
|
|
90
|
+
return { service, clientCP }
|
|
91
|
+
}
|
|
92
|
+
|
|
18
93
|
describe('ContentService', () => {
|
|
19
94
|
describe('convertOptionsToParams', () => {
|
|
20
95
|
it('maps a flat SEO slug filter to the client-cp slug param', () => {
|
|
@@ -95,4 +170,207 @@ describe('ContentService', () => {
|
|
|
95
170
|
expect('locale' in options.cmsOptions).toBe(false)
|
|
96
171
|
})
|
|
97
172
|
})
|
|
173
|
+
|
|
174
|
+
describe('Content Platform template list cache', () => {
|
|
175
|
+
const FIVE_MINUTES = 5 * 60 * 1000
|
|
176
|
+
|
|
177
|
+
beforeEach(() => {
|
|
178
|
+
vi.mocked(isContentPlatformSource).mockReturnValue(true)
|
|
179
|
+
vi.spyOn(console, 'warn').mockImplementation(() => {})
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
afterEach(() => {
|
|
183
|
+
vi.mocked(isContentPlatformSource).mockReset()
|
|
184
|
+
vi.restoreAllMocks()
|
|
185
|
+
vi.useRealTimers()
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
it('keeps Content Platform author emails out of public page content', async () => {
|
|
189
|
+
const { service, clientCP } = createServiceWithClient()
|
|
190
|
+
clientCP.getEntryBySlug.mockResolvedValueOnce({
|
|
191
|
+
sections: [{ name: 'Direct' }],
|
|
192
|
+
createdBy: 'editor@example.com',
|
|
193
|
+
updatedBy: 'other@example.com',
|
|
194
|
+
})
|
|
195
|
+
|
|
196
|
+
const directPage = await service.getSingleContent({
|
|
197
|
+
contentType: 'pdp',
|
|
198
|
+
slug: 'product-slug',
|
|
199
|
+
})
|
|
200
|
+
const { data } = await service.getMultipleContent({ contentType: 'pdp' })
|
|
201
|
+
const listedPage = data[0]
|
|
202
|
+
|
|
203
|
+
expect(directPage.sections).toEqual([{ name: 'Direct' }])
|
|
204
|
+
expect(directPage).not.toHaveProperty('createdBy')
|
|
205
|
+
expect(directPage).not.toHaveProperty('updatedBy')
|
|
206
|
+
expect(listedPage.id).toBe('generic')
|
|
207
|
+
expect(listedPage.name).toBe('generic')
|
|
208
|
+
expect(listedPage.sections).toEqual([{ name: 'Generic' }])
|
|
209
|
+
expect(listedPage).not.toHaveProperty('createdBy')
|
|
210
|
+
expect(listedPage).not.toHaveProperty('updatedBy')
|
|
211
|
+
expect(listedPage).not.toHaveProperty('account')
|
|
212
|
+
expect(listedPage).not.toHaveProperty('storeId')
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
it('shares one list and entry fetch across concurrent PLPs with different slugs', async () => {
|
|
216
|
+
const { service, clientCP } = createServiceWithClient()
|
|
217
|
+
|
|
218
|
+
const [collectionPage, otherPage, unknownPage] = await Promise.all([
|
|
219
|
+
service.getPlpContent({ slug: 'colecao/camisetas' }, []),
|
|
220
|
+
service.getPlpContent({ slug: 'outra' }, []),
|
|
221
|
+
service.getPlpContent({ slug: 'nao-existe' }, []),
|
|
222
|
+
])
|
|
223
|
+
|
|
224
|
+
expect(clientCP.listEntries).toHaveBeenCalledTimes(1)
|
|
225
|
+
expect(clientCP.getEntry).toHaveBeenCalledTimes(3)
|
|
226
|
+
expect(collectionPage.sections).toEqual([{ name: 'Collection' }])
|
|
227
|
+
expect(otherPage.sections).toEqual([{ name: 'Other' }])
|
|
228
|
+
expect(unknownPage.sections).toEqual([{ name: 'Generic' }])
|
|
229
|
+
})
|
|
230
|
+
|
|
231
|
+
it('reuses the cached list within the TTL', async () => {
|
|
232
|
+
const { service, clientCP } = createServiceWithClient()
|
|
233
|
+
|
|
234
|
+
await service.getPlpContent({ slug: 'colecao' }, [])
|
|
235
|
+
await service.getPlpContent({ slug: 'outra' }, [])
|
|
236
|
+
|
|
237
|
+
expect(clientCP.listEntries).toHaveBeenCalledTimes(1)
|
|
238
|
+
expect(clientCP.getEntry).toHaveBeenCalledTimes(3)
|
|
239
|
+
})
|
|
240
|
+
|
|
241
|
+
it('still prefers a direct slug match over the cached list', async () => {
|
|
242
|
+
const { service, clientCP } = createServiceWithClient()
|
|
243
|
+
await service.getPlpContent({ slug: 'colecao' }, [])
|
|
244
|
+
|
|
245
|
+
clientCP.getEntryBySlug.mockResolvedValueOnce({
|
|
246
|
+
sections: [{ name: 'Direct' }],
|
|
247
|
+
})
|
|
248
|
+
const page = await service.getPlpContent({ slug: 'colecao' }, [])
|
|
249
|
+
|
|
250
|
+
expect(page.sections).toEqual([{ name: 'Direct' }])
|
|
251
|
+
expect(clientCP.listEntries).toHaveBeenCalledTimes(1)
|
|
252
|
+
})
|
|
253
|
+
|
|
254
|
+
it('consumes every scroll page once', async () => {
|
|
255
|
+
const { service, clientCP } = createServiceWithClient([
|
|
256
|
+
['generic'],
|
|
257
|
+
['collection'],
|
|
258
|
+
['other'],
|
|
259
|
+
])
|
|
260
|
+
|
|
261
|
+
await Promise.all([
|
|
262
|
+
service.getMultipleContent({ contentType: 'plp' }),
|
|
263
|
+
service.getMultipleContent({ contentType: 'plp' }),
|
|
264
|
+
])
|
|
265
|
+
const { data } = await service.getMultipleContent({ contentType: 'plp' })
|
|
266
|
+
|
|
267
|
+
expect(clientCP.listEntries).toHaveBeenCalledTimes(3)
|
|
268
|
+
expect(
|
|
269
|
+
clientCP.listEntries.mock.calls.map(([, scroll]) => scroll)
|
|
270
|
+
).toEqual([undefined, '1', '2'])
|
|
271
|
+
expect(data.map((entry) => entry.id)).toEqual([
|
|
272
|
+
'generic',
|
|
273
|
+
'collection',
|
|
274
|
+
'other',
|
|
275
|
+
])
|
|
276
|
+
})
|
|
277
|
+
|
|
278
|
+
it('keeps separate entries per content type', async () => {
|
|
279
|
+
const { service, clientCP } = createServiceWithClient()
|
|
280
|
+
|
|
281
|
+
await service.getMultipleContent({ contentType: 'plp' })
|
|
282
|
+
await service.getMultipleContent({ contentType: 'pdp' })
|
|
283
|
+
await service.getMultipleContent({ contentType: 'pdp' })
|
|
284
|
+
|
|
285
|
+
expect(clientCP.listEntries).toHaveBeenCalledTimes(2)
|
|
286
|
+
expect(
|
|
287
|
+
clientCP.listEntries.mock.calls.map(([params]) => params.contentType)
|
|
288
|
+
).toEqual(['plp', 'pdp'])
|
|
289
|
+
})
|
|
290
|
+
|
|
291
|
+
it('keeps separate entries per locale', async () => {
|
|
292
|
+
const { service, clientCP } = createServiceWithClient()
|
|
293
|
+
|
|
294
|
+
await service.getMultipleContent({ contentType: 'plp', locale: 'pt-BR' })
|
|
295
|
+
await service.getMultipleContent({ contentType: 'plp', locale: 'en-US' })
|
|
296
|
+
await service.getMultipleContent({ contentType: 'plp', locale: 'pt-BR' })
|
|
297
|
+
|
|
298
|
+
expect(clientCP.listEntries).toHaveBeenCalledTimes(2)
|
|
299
|
+
expect(
|
|
300
|
+
clientCP.listEntries.mock.calls.map(([params]) => params.locale)
|
|
301
|
+
).toEqual(['pt-BR', 'en-US'])
|
|
302
|
+
})
|
|
303
|
+
|
|
304
|
+
it('bypasses the cache for previews', async () => {
|
|
305
|
+
const { service, clientCP } = createServiceWithClient()
|
|
306
|
+
const previewParams: ContentParams = {
|
|
307
|
+
contentType: 'plp',
|
|
308
|
+
previewData: {
|
|
309
|
+
contentType: 'plp',
|
|
310
|
+
documentId: 'collection',
|
|
311
|
+
versionId: 'version-1',
|
|
312
|
+
},
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
await service.getMultipleContent({ contentType: 'plp' })
|
|
316
|
+
await service.getMultipleContent(previewParams)
|
|
317
|
+
await service.getMultipleContent(previewParams)
|
|
318
|
+
await service.getMultipleContent({ contentType: 'plp' })
|
|
319
|
+
|
|
320
|
+
expect(clientCP.listEntries).toHaveBeenCalledTimes(3)
|
|
321
|
+
expect(clientCP.getEntry).toHaveBeenCalledTimes(3)
|
|
322
|
+
expect(clientCP.previewEntryById).toHaveBeenCalledTimes(6)
|
|
323
|
+
})
|
|
324
|
+
|
|
325
|
+
it('does not cache failures', async () => {
|
|
326
|
+
const { service, clientCP } = createServiceWithClient()
|
|
327
|
+
const error = new Error('Request failed with status code 500')
|
|
328
|
+
clientCP.listEntries.mockRejectedValueOnce(error)
|
|
329
|
+
|
|
330
|
+
await expect(
|
|
331
|
+
service.getMultipleContent({ contentType: 'plp' })
|
|
332
|
+
).rejects.toBe(error)
|
|
333
|
+
const { data } = await service.getMultipleContent({ contentType: 'plp' })
|
|
334
|
+
|
|
335
|
+
expect(clientCP.listEntries).toHaveBeenCalledTimes(2)
|
|
336
|
+
expect(data).toHaveLength(3)
|
|
337
|
+
})
|
|
338
|
+
|
|
339
|
+
it('does not let a late failure evict a newer fetch', async () => {
|
|
340
|
+
vi.useFakeTimers()
|
|
341
|
+
const { service, clientCP } = createServiceWithClient()
|
|
342
|
+
let rejectFirst: (err: Error) => void = () => {}
|
|
343
|
+
clientCP.listEntries.mockImplementationOnce(
|
|
344
|
+
() =>
|
|
345
|
+
new Promise((_, reject) => {
|
|
346
|
+
rejectFirst = reject
|
|
347
|
+
})
|
|
348
|
+
)
|
|
349
|
+
|
|
350
|
+
const first = service.getMultipleContent({ contentType: 'plp' })
|
|
351
|
+
const firstResult = expect(first).rejects.toThrow('late failure')
|
|
352
|
+
vi.advanceTimersByTime(FIVE_MINUTES)
|
|
353
|
+
await service.getMultipleContent({ contentType: 'plp' })
|
|
354
|
+
|
|
355
|
+
rejectFirst(new Error('late failure'))
|
|
356
|
+
await firstResult
|
|
357
|
+
await service.getMultipleContent({ contentType: 'plp' })
|
|
358
|
+
|
|
359
|
+
expect(clientCP.listEntries).toHaveBeenCalledTimes(2)
|
|
360
|
+
})
|
|
361
|
+
|
|
362
|
+
it('fetches the list again after the TTL', async () => {
|
|
363
|
+
vi.useFakeTimers()
|
|
364
|
+
const { service, clientCP } = createServiceWithClient()
|
|
365
|
+
|
|
366
|
+
await service.getMultipleContent({ contentType: 'plp' })
|
|
367
|
+
vi.advanceTimersByTime(FIVE_MINUTES - 1)
|
|
368
|
+
await service.getMultipleContent({ contentType: 'plp' })
|
|
369
|
+
expect(clientCP.listEntries).toHaveBeenCalledTimes(1)
|
|
370
|
+
|
|
371
|
+
vi.advanceTimersByTime(1)
|
|
372
|
+
await service.getMultipleContent({ contentType: 'plp' })
|
|
373
|
+
expect(clientCP.listEntries).toHaveBeenCalledTimes(2)
|
|
374
|
+
})
|
|
375
|
+
})
|
|
98
376
|
})
|