@faststore/core 4.7.0-dev.1 → 4.7.0-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 +84 -87
- package/CHANGELOG.md +6 -0
- package/package.json +6 -6
- package/src/components/account/Layout/Layout.tsx +5 -4
- package/src/pages/pvt/account/cards/index.tsx +14 -0
- package/src/sdk/account/getMyAccountRoutes.ts +1 -1
- package/test/components/account/Layout.test.tsx +17 -0
- package/test/pages/pvt/account/cards/index.test.ts +22 -18
- package/test/sdk/account/getMyAccountRoutes.test.ts +4 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@4.7.0-dev.
|
|
2
|
+
> @faststore/core@4.7.0-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.7.0-dev.
|
|
6
|
+
> @faststore/core@4.7.0-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 /home/runner/work/faststore/faststore/packages/core/@generated/
|
|
20
20
|
[32m[COMPLETED][39m Generate outputs
|
|
21
21
|
|
|
22
|
-
> @faststore/core@4.7.0-dev.
|
|
22
|
+
> @faststore/core@4.7.0-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.7.0-dev.
|
|
2
|
+
> @faststore/core@4.7.0-dev.1 test /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> vitest run
|
|
4
4
|
|
|
5
5
|
|
|
@@ -7,19 +7,17 @@
|
|
|
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 943[2mms[22m[39m
|
|
10
11
|
Browserslist: browsers data (caniuse-lite) is 6 months old. Please run:
|
|
11
12
|
npx update-browserslist-db@latest
|
|
12
13
|
Why you should do it regularly: https://github.com/browserslist/update-db#readme
|
|
13
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
14
|
-
|
|
15
|
-
[33m[2m✓[22m[39m
|
|
16
|
-
[33m[2m✓[22m[39m
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
[33m[2m✓[22m[39m shows the tab bar and renders Personal cards by default [33m 1203[2mms[22m[39m
|
|
21
|
-
[33m[2m✓[22m[39m paginates when there are more than 25 cards [33m 309[2mms[22m[39m
|
|
22
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 148[2mms[22m[39m
|
|
14
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/ContractSwitcher.browser.test.tsx [2m([22m[2m13 tests[22m[2m)[22m[33m 2342[2mms[22m[39m
|
|
15
|
+
[33m[2m✓[22m[39m shows an error state when the list fails to load [33m 612[2mms[22m[39m
|
|
16
|
+
[33m[2m✓[22m[39m requires selecting a contract before Confirm is enabled, then switches (REQ-03) [33m 319[2mms[22m[39m
|
|
17
|
+
[33m[2m✓[22m[39m keeps Confirm disabled until a different contract is selected [33m 325[2mms[22m[39m
|
|
18
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 277[2mms[22m[39m
|
|
19
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/cards/MyAccountListCards.browser.test.tsx [2m([22m[2m14 tests[22m[2m)[22m[33m 1907[2mms[22m[39m
|
|
20
|
+
[33m[2m✓[22m[39m shows the tab bar and renders Personal cards by default [33m 971[2mms[22m[39m
|
|
23
21
|
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/reconcileSessionLocale.browser.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 27[2mms[22m[39m
|
|
24
22
|
[90mstderr[2m | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx
|
|
25
23
|
[22m[39mError in optimistic validation: TypeError: Failed to parse URL from /api/graphql?operationName=ValidateCartMutation&operationHash=3c71b0d3fc2bade14df68abfa271858beb361b12
|
|
@@ -50,8 +48,9 @@ Browserslist: browsers data (caniuse-lite) is 6 months old. Please run:
|
|
|
50
48
|
[90mstderr[2m | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx[2m > [22m[2mRecommendationShelf[2m > [22m[2mrenders nothing when there is an error
|
|
51
49
|
[22m[39mError fetching recommendations [90mundefined[39m boom for campaign vrn:recommendations:acc:rec-top-items-v2:campaign-1
|
|
52
50
|
|
|
53
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
54
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
51
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/recommendations/useRecommendationShelf.browser.test.tsx [2m([22m[2m10 tests[22m[2m)[22m[32m 171[2mms[22m[39m
|
|
52
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 223[2mms[22m[39m
|
|
53
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/getInitialSession.browser.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 17[2mms[22m[39m
|
|
55
54
|
[90mstderr[2m | test/pages/password-protection.browser.test.tsx[2m > [22m[2mPasswordProtectionLogin[2m > [22m[2mposts the password and redirects to the requested return path
|
|
56
55
|
[22m[39mWarning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
|
|
57
56
|
|
|
@@ -281,13 +280,11 @@ act(() => {
|
|
|
281
280
|
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
|
|
282
281
|
at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
|
|
283
282
|
|
|
284
|
-
[32m✓[39m [30m[46m browser [49m[39m test/pages/password-protection.browser.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[33m
|
|
285
|
-
[33m[2m✓[22m[39m renders the password protection form [33m
|
|
286
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/changeContractToken.browser.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 54[2mms[22m[39m
|
|
290
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/useAvailableContracts.browser.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 40[2mms[22m[39m
|
|
283
|
+
[32m✓[39m [30m[46m browser [49m[39m test/pages/password-protection.browser.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[33m 1146[2mms[22m[39m
|
|
284
|
+
[33m[2m✓[22m[39m renders the password protection form [33m 600[2mms[22m[39m
|
|
285
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/changeContractToken.browser.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 52[2mms[22m[39m
|
|
286
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawer.browser.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[33m 1220[2mms[22m[39m
|
|
287
|
+
[33m[2m✓[22m[39m renders the menu view with contract details and manage footer [33m 623[2mms[22m[39m
|
|
291
288
|
[90mstderr[2m | test/sdk/localization/store-url.browser.test.ts
|
|
292
289
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
293
290
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -296,9 +293,10 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
296
293
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
|
|
297
294
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
298
295
|
|
|
299
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/localization/store-url.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
300
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
301
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
296
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/localization/store-url.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
297
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/useAvailableContracts.browser.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 28[2mms[22m[39m
|
|
298
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/templates/SearchPage/SearchWrapper.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 37[2mms[22m[39m
|
|
299
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/useSwitchContract.browser.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 28[2mms[22m[39m
|
|
302
300
|
[90mstderr[2m | test/components/account/doLogout.browser.test.ts
|
|
303
301
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
304
302
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -307,10 +305,9 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
307
305
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
|
|
308
306
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
309
307
|
|
|
310
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/doLogout.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
311
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountListCards.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
312
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawerHeader.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
313
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawerFooter.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 222[2mms[22m[39m
|
|
308
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/doLogout.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 23[2mms[22m[39m
|
|
309
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountListCards.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 68[2mms[22m[39m
|
|
310
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawerHeader.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 242[2mms[22m[39m
|
|
314
311
|
[90mstderr[2m | test/sdk/account/clearPersistedSessionState.browser.test.ts
|
|
315
312
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
316
313
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -319,12 +316,10 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
319
316
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
|
|
320
317
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
321
318
|
|
|
319
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawerFooter.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 240[2mms[22m[39m
|
|
320
|
+
[32m✓[39m [30m[46m browser [49m[39m test/utils/isLocalHost.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
322
321
|
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/clearPersistedSessionState.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
323
|
-
[32m✓[39m [30m[46m browser [49m[39m test/utils/isLocalHost.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
324
322
|
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/reconcileSessionLocale.disabled.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
325
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/localization/bindingPaths.test.ts [2m([22m[2m71 tests[22m[2m)[22m[32m 27[2mms[22m[39m
|
|
326
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/skeletons/ProductGridSkeleton.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 42[2mms[22m[39m
|
|
327
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/password-protection-service.test.ts [2m([22m[2m22 tests[22m[2m)[22m[32m 33[2mms[22m[39m
|
|
328
323
|
[90mstderr[2m | test/sdk/account/refreshToken.browser.test.ts
|
|
329
324
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
330
325
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -333,11 +328,14 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
333
328
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
|
|
334
329
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
335
330
|
|
|
336
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/refreshToken.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
337
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/
|
|
338
|
-
[32m✓[39m [30m[
|
|
339
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
340
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
331
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/refreshToken.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
332
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/localization/bindingPaths.test.ts [2m([22m[2m71 tests[22m[2m)[22m[32m 28[2mms[22m[39m
|
|
333
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/skeletons/ProductGridSkeleton.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 32[2mms[22m[39m
|
|
334
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/match-url.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 11[2mms[22m[39m
|
|
335
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/password-protection-service.test.ts [2m([22m[2m22 tests[22m[2m)[22m[32m 29[2mms[22m[39m
|
|
336
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/unlock.test.ts [2m([22m[2m15 tests[22m[2m)[22m[32m 267[2mms[22m[39m
|
|
337
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/useBindingSelector.test.tsx [2m([22m[2m22 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
338
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/bindingSelector.test.ts [2m([22m[2m18 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
341
339
|
[90mstderr[2m | test/components/search/SearchInputComponent.test.tsx
|
|
342
340
|
[22m[39mWarning: forwardRef render functions accept exactly two parameters: props and ref. Did you forget to use the ref parameter?
|
|
343
341
|
|
|
@@ -401,19 +399,19 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
|
|
|
401
399
|
at Suspense
|
|
402
400
|
at Wrapper (/home/runner/work/faststore/faststore/packages/core/test/components/search/SearchInputComponent.test.tsx:106:20)
|
|
403
401
|
|
|
404
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchInputComponent.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
405
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/search/useSearchHistory.test.ts [2m([22m[2m13 tests[22m[2m)[22m[32m
|
|
406
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/cookieCacheBusting.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m
|
|
407
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/clearCookies.test.ts [2m([22m[2m20 tests[22m[2m)[22m[32m 22[2mms[22m[39m
|
|
402
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchInputComponent.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m 78[2mms[22m[39m
|
|
403
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/search/useSearchHistory.test.ts [2m([22m[2m13 tests[22m[2m)[22m[32m 44[2mms[22m[39m
|
|
404
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/cookieCacheBusting.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
408
405
|
[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
|
|
409
406
|
[22m[39m{ extensions: { status: [33m401[39m } }
|
|
410
407
|
|
|
411
408
|
[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
|
|
412
409
|
[22m[39m{ extensions: { status: [33m502[39m } }
|
|
413
410
|
|
|
414
|
-
[32m✓[39m [30m[43m node [49m[39m test/pages/pvt/account/cards/index.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
411
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/pvt/account/cards/index.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 11[2mms[22m[39m
|
|
412
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/clearCookies.test.ts [2m([22m[2m20 tests[22m[2m)[22m[32m 25[2mms[22m[39m
|
|
415
413
|
[32m✓[39m [30m[43m node [49m[39m test/experimental/myAccountCmsServerSideProps.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
416
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountListQuotesTable.test.tsx [2m([22m[2m12 tests[22m[2m)[22m[33m
|
|
414
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountListQuotesTable.test.tsx [2m([22m[2m12 tests[22m[2m)[22m[33m 380[2mms[22m[39m
|
|
417
415
|
[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
|
|
418
416
|
[22m[39mGraphql execution returned with error: [
|
|
419
417
|
{
|
|
@@ -506,66 +504,65 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
|
|
|
506
504
|
at 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:37
|
|
507
505
|
at Traces.$ (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/traces.CCmnQaNT.js:142:27)
|
|
508
506
|
|
|
509
|
-
[32m✓[39m [30m[43m node [49m[39m test/pages/api/graphql.test.ts [2m([22m[2m17 tests[22m[2m)[22m[32m
|
|
507
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/graphql.test.ts [2m([22m[2m17 tests[22m[2m)[22m[32m 36[2mms[22m[39m
|
|
510
508
|
[90mstderr[2m | test/sdk/account/useSetPassword.test.ts[2m > [22m[2museSetPassword[2m > [22m[2mmaps wrongcredentials error responses to the existing message
|
|
511
509
|
[22m[39mSet password request failed: Bad Request
|
|
512
510
|
|
|
513
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/useSetPassword.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
514
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountListQuotes.test.tsx [2m([22m[2m9 tests[22m[2m)[22m[33m
|
|
515
|
-
[33m[2m✓[22m[39m navigates with the search term on blur [33m
|
|
516
|
-
[33m[2m✓[22m[39m navigates without a label param when the search is cleared [33m
|
|
517
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/quoteFilters.test.ts [2m([22m[2m23 tests[22m[2m)[22m[32m 38[2mms[22m[39m
|
|
518
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/multipleTemplates.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
511
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/useSetPassword.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 30[2mms[22m[39m
|
|
512
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountListQuotes.test.tsx [2m([22m[2m9 tests[22m[2m)[22m[33m 821[2mms[22m[39m
|
|
513
|
+
[33m[2m✓[22m[39m navigates with the search term on blur [33m 361[2mms[22m[39m
|
|
514
|
+
[33m[2m✓[22m[39m navigates without a label param when the search is cleared [33m 359[2mms[22m[39m
|
|
519
515
|
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntryOperation.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 39[2mms[22m[39m
|
|
520
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
521
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
522
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
523
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
524
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/
|
|
525
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
526
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
527
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/index.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m
|
|
528
|
-
[33m[2m✓[22m[39m should
|
|
529
|
-
|
|
530
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
531
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
532
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
533
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
534
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/cart/waitForSessionValidated.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
516
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/quoteFilters.test.ts [2m([22m[2m23 tests[22m[2m)[22m[32m 34[2mms[22m[39m
|
|
517
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/multipleTemplates.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
518
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/localization/localizeRedirectDestination.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
519
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/getMyAccountRoutes.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
520
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntryUpload.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 48[2mms[22m[39m
|
|
521
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesFilterSlider.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[32m 137[2mms[22m[39m
|
|
522
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/analytics/useStartRecommendationSession.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 39[2mms[22m[39m
|
|
523
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/index.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 916[2mms[22m[39m
|
|
524
|
+
[33m[2m✓[22m[39m should handle options and execute [33m 385[2mms[22m[39m
|
|
525
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntry.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 47[2mms[22m[39m
|
|
526
|
+
[32m✓[39m [30m[43m node [49m[39m test/proxy.localization.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 36[2mms[22m[39m
|
|
527
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/session/syncSalesChannelFromOrderForm.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
528
|
+
[32m✓[39m [30m[43m node [49m[39m test/proxy.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 15[2mms[22m[39m
|
|
529
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/webops-api.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 15[2mms[22m[39m
|
|
535
530
|
[32m✓[39m [30m[43m node [49m[39m test/server/content/service.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
536
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderFormItems.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m
|
|
537
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
538
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/refreshToken.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
531
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderFormItems.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 42[2mms[22m[39m
|
|
532
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesSelectedTags.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 110[2mms[22m[39m
|
|
533
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/refreshToken.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
534
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/cart/waitForSessionValidated.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
535
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/cms/global.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
539
536
|
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/store-url.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
540
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/auth/useAuth.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
537
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/auth/useAuth.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 29[2mms[22m[39m
|
|
538
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesStatusSelector.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m 119[2mms[22m[39m
|
|
541
539
|
[32m✓[39m [30m[43m node [49m[39m test/sdk/analytics/hasEnabledRecommendationShelf.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
542
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesStatusSelector.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m 131[2mms[22m[39m
|
|
543
540
|
[32m✓[39m [30m[43m node [49m[39m test/utils/getRequestHostname.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
544
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
545
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
541
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/rootSpan.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 39[2mms[22m[39m
|
|
542
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/preview.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
543
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchInput.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
544
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/account/Layout.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m 63[2mms[22m[39m
|
|
546
545
|
[32m✓[39m [30m[43m node [49m[39m test/utils/validateSessionRefreshToken.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
547
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
548
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
546
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/vrn.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
547
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/retry.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
549
548
|
[32m✓[39m [30m[43m node [49m[39m test/server/cms/index.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
550
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/retry.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
551
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/account/Layout.test.tsx [2m([22m[2m4 tests[22m[2m)[22m[32m 52[2mms[22m[39m
|
|
552
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/useRecommendationUserId.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 195[2mms[22m[39m
|
|
553
549
|
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/getB2BSessionClaims.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
554
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/unlockResponse.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m
|
|
550
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/unlockResponse.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
555
551
|
[32m✓[39m [30m[43m node [49m[39m test/server/cms/myAccountDefaultSections.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
552
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/useRecommendationUserId.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 188[2mms[22m[39m
|
|
556
553
|
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/useRecommendations.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
557
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
558
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
554
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/account/OrganizationDrawerBody.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 38[2mms[22m[39m
|
|
555
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/isLocalHost.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
559
556
|
[32m✓[39m [30m[43m node [49m[39m test/utils/userOrderStatus.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
560
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/getCookie.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
561
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/analytics/utils.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
562
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/auth/ProfileChallenge.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 27[2mms[22m[39m
|
|
557
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/getCookie.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
558
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/analytics/utils.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
563
559
|
[32m✓[39m [30m[43m node [49m[39m test/instrumentation.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
564
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
565
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuoteStatusBadge.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
560
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/auth/ProfileChallenge.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 28[2mms[22m[39m
|
|
561
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuoteStatusBadge.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 31[2mms[22m[39m
|
|
562
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/clearPersistedSessionState.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
566
563
|
|
|
567
564
|
[2m Test Files [22m [1m[32m87 passed[39m[22m[90m (87)[39m
|
|
568
|
-
[2m Tests [22m [1m[
|
|
569
|
-
[2m Start at [22m
|
|
570
|
-
[2m Duration [22m 41.
|
|
565
|
+
[2m Tests [22m [1m[32m698 passed[39m[22m[90m (698)[39m
|
|
566
|
+
[2m Start at [22m 20:10:15
|
|
567
|
+
[2m Duration [22m 41.13s[2m (transform 9.78s, setup 0ms, import 36.14s, tests 13.03s, environment 52.30s)[22m
|
|
571
568
|
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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.7.0-dev.2](https://github.com/vtex/faststore/compare/v4.7.0-dev.1...v4.7.0-dev.2) (2026-08-24)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- gate the Cards route and sidebar entry on org membership ([#3463](https://github.com/vtex/faststore/issues/3463)) ([fa8c42e](https://github.com/vtex/faststore/commit/fa8c42e4bf242de9122dd79ba2681f9117f71695)), closes [#3443](https://github.com/vtex/faststore/issues/3443) [#3443](https://github.com/vtex/faststore/issues/3443) [#3443](https://github.com/vtex/faststore/issues/3443) [#3443](https://github.com/vtex/faststore/issues/3443) [#3443](https://github.com/vtex/faststore/issues/3443)
|
|
11
|
+
|
|
6
12
|
# [4.7.0-dev.1](https://github.com/vtex/faststore/compare/v4.7.0-dev.0...v4.7.0-dev.1) (2026-08-24)
|
|
7
13
|
|
|
8
14
|
**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.7.0-dev.
|
|
3
|
+
"version": "4.7.0-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.7.0-dev.
|
|
75
|
-
"@faststore/diagnostics": "4.7.0-dev.
|
|
76
|
-
"@faststore/lighthouse": "4.7.0-dev.
|
|
77
|
-
"@faststore/sdk": "4.7.0-dev.
|
|
78
|
-
"@faststore/ui": "4.7.0-dev.
|
|
74
|
+
"@faststore/api": "4.7.0-dev.2",
|
|
75
|
+
"@faststore/diagnostics": "4.7.0-dev.2",
|
|
76
|
+
"@faststore/lighthouse": "4.7.0-dev.2",
|
|
77
|
+
"@faststore/sdk": "4.7.0-dev.2",
|
|
78
|
+
"@faststore/ui": "4.7.0-dev.2"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@cypress/code-coverage": "^3.12.1",
|
|
@@ -35,10 +35,11 @@ const Layout = ({
|
|
|
35
35
|
})
|
|
36
36
|
: menuRoutes
|
|
37
37
|
|
|
38
|
-
// Cards is
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
//
|
|
38
|
+
// Cards is org-gated like Quotes: without a unit/contract association there
|
|
39
|
+
// is no card list to show (the Saved-cards service has no customer record
|
|
40
|
+
// for such a buyer), so the entry is hidden rather than leading to an empty
|
|
41
|
+
// page. `useAdHocCard` is a separate, finer gate that only affects the
|
|
42
|
+
// Personal-tab rendering inside the page itself — it never hides the entry.
|
|
42
43
|
const routes = (
|
|
43
44
|
isRepresentative
|
|
44
45
|
? menuItems
|
|
@@ -131,6 +131,20 @@ const getServerSidePropsBase: GetServerSideProps<
|
|
|
131
131
|
return { redirect }
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
// Cards requires a unit/contract association, mirroring the sidebar gate in
|
|
135
|
+
// account/Layout (ROUTES_ONLY_FOR_B2B_MEMBERS). This resolves O1: the
|
|
136
|
+
// combinations without an association used to render a lone, inert Personal
|
|
137
|
+
// tab over a list the Saved-cards service answers 500 for. Gated ahead of
|
|
138
|
+
// the query so those buyers never trigger that call.
|
|
139
|
+
if (!hasOrgAssociation) {
|
|
140
|
+
return {
|
|
141
|
+
redirect: {
|
|
142
|
+
destination: '/pvt/account/404',
|
|
143
|
+
permanent: false,
|
|
144
|
+
},
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
134
148
|
const [
|
|
135
149
|
globalSectionsPromise,
|
|
136
150
|
globalSectionsHeaderPromise,
|
|
@@ -37,7 +37,7 @@ export const SECURITY_ROUTE = '/pvt/account/security'
|
|
|
37
37
|
export const CARDS_ROUTE = '/pvt/account/cards'
|
|
38
38
|
export const QUOTES_ROUTE = '/pvt/account/quotes'
|
|
39
39
|
|
|
40
|
-
export const ROUTES_ONLY_FOR_B2B_MEMBERS = [QUOTES_ROUTE]
|
|
40
|
+
export const ROUTES_ONLY_FOR_B2B_MEMBERS = [QUOTES_ROUTE, CARDS_ROUTE]
|
|
41
41
|
|
|
42
42
|
const ROUTE_LABEL_KEYS: Record<string, keyof AccountNavigationLabels> = {
|
|
43
43
|
[PROFILE_ROUTE]: 'profileLabel',
|
|
@@ -39,6 +39,23 @@ describe('Layout', () => {
|
|
|
39
39
|
expect(screen.getByText('Quotes')).toBeTruthy()
|
|
40
40
|
})
|
|
41
41
|
|
|
42
|
+
it('hides the Cards route when the user is not an org member', () => {
|
|
43
|
+
mockUseSession.mockReturnValue({ b2b: null })
|
|
44
|
+
|
|
45
|
+
render(<Layout accountName="Jane Doe">content</Layout>)
|
|
46
|
+
|
|
47
|
+
expect(screen.queryByText('Cards')).toBeNull()
|
|
48
|
+
expect(screen.getByText('Profile')).toBeTruthy()
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
it('shows the Cards route when the user belongs to an org unit', () => {
|
|
52
|
+
mockUseSession.mockReturnValue({ b2b: { unitId: 'unit-1' } })
|
|
53
|
+
|
|
54
|
+
render(<Layout accountName="Jane Doe">content</Layout>)
|
|
55
|
+
|
|
56
|
+
expect(screen.getByText('Cards')).toBeTruthy()
|
|
57
|
+
})
|
|
58
|
+
|
|
42
59
|
it('hides User Details when not a representative, regardless of org membership', () => {
|
|
43
60
|
mockUseSession.mockReturnValue({ b2b: { unitId: 'unit-1' } })
|
|
44
61
|
|
|
@@ -85,11 +85,26 @@ describe('Cards page getServerSideProps', () => {
|
|
|
85
85
|
expect(mockExecute).not.toHaveBeenCalled()
|
|
86
86
|
})
|
|
87
87
|
|
|
88
|
-
it('redirects to /pvt/account/
|
|
88
|
+
it('redirects to /pvt/account/404 when the buyer has no org association, before querying', async () => {
|
|
89
89
|
mockGetB2BSessionClaims.mockReturnValueOnce({
|
|
90
90
|
hasOrgAssociation: false,
|
|
91
91
|
hasCustomerId: false,
|
|
92
92
|
})
|
|
93
|
+
|
|
94
|
+
const result: any = await getServerSideProps(makeContext())
|
|
95
|
+
|
|
96
|
+
expect(result.redirect.destination).toBe('/pvt/account/404')
|
|
97
|
+
// Gated ahead of the Saved-cards call: a buyer who cannot reach the page
|
|
98
|
+
// must not cost a round trip to a service that answers 500 for shoppers
|
|
99
|
+
// with no customer record.
|
|
100
|
+
expect(mockExecute).not.toHaveBeenCalled()
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
it('redirects to /pvt/account/403 when the query fails with 401/403', async () => {
|
|
104
|
+
mockGetB2BSessionClaims.mockReturnValueOnce({
|
|
105
|
+
hasOrgAssociation: true,
|
|
106
|
+
hasCustomerId: false,
|
|
107
|
+
})
|
|
93
108
|
mockExecute.mockResolvedValueOnce({
|
|
94
109
|
data: undefined,
|
|
95
110
|
errors: [{ extensions: { status: 401 } }],
|
|
@@ -102,7 +117,7 @@ describe('Cards page getServerSideProps', () => {
|
|
|
102
117
|
|
|
103
118
|
it('renders the error state (no redirect) when the query fails with a non-auth status', async () => {
|
|
104
119
|
mockGetB2BSessionClaims.mockReturnValueOnce({
|
|
105
|
-
hasOrgAssociation:
|
|
120
|
+
hasOrgAssociation: true,
|
|
106
121
|
hasCustomerId: false,
|
|
107
122
|
})
|
|
108
123
|
mockExecute.mockResolvedValueOnce({
|
|
@@ -135,7 +150,7 @@ describe('Cards page getServerSideProps', () => {
|
|
|
135
150
|
expect(result.props).not.toHaveProperty('hasAdHocCardAccess')
|
|
136
151
|
})
|
|
137
152
|
|
|
138
|
-
it('
|
|
153
|
+
it('does not gate the route on useAdHocCard: canViewPersonalCards is false but an org member still gets the page', async () => {
|
|
139
154
|
mockGetB2BSessionClaims.mockReturnValueOnce({
|
|
140
155
|
hasOrgAssociation: true,
|
|
141
156
|
hasCustomerId: false,
|
|
@@ -165,21 +180,10 @@ describe('Cards page getServerSideProps', () => {
|
|
|
165
180
|
expect(result.props.accountPageData.sharedCards).toEqual([CARD_SHARED])
|
|
166
181
|
})
|
|
167
182
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
})
|
|
173
|
-
mockSuccessfulExecute({ hasAdHocCardAccess: false })
|
|
174
|
-
|
|
175
|
-
const result: any = await getServerSideProps(makeContext())
|
|
176
|
-
|
|
177
|
-
// Without hasOrgAssociation, the component still renders the Personal
|
|
178
|
-
// tab (the "kept as-is" O1 combination) — stripping the data here would
|
|
179
|
-
// silently regress a buyer this gate was never meant to touch, even
|
|
180
|
-
// though canViewPersonalCards itself is false.
|
|
181
|
-
expect(result.props.accountPageData.personalCards).toEqual([CARD_PERSONAL])
|
|
182
|
-
})
|
|
183
|
+
// The previous FR-7 case ("keeps personal cards in the payload when there is
|
|
184
|
+
// no org association") is gone by design: O1 was resolved by gating the
|
|
185
|
+
// route on org membership, so that combination now 404s and never reaches a
|
|
186
|
+
// payload at all. See the no-org-association gate test above.
|
|
183
187
|
|
|
184
188
|
it('defaults hasAdHocCardAccess to allowed when the query field is missing', async () => {
|
|
185
189
|
mockGetB2BSessionClaims.mockReturnValueOnce({
|
|
@@ -125,6 +125,10 @@ describe('getMyAccountRoutes', () => {
|
|
|
125
125
|
it('marks Quotes as a B2B-only route', () => {
|
|
126
126
|
expect(ROUTES_ONLY_FOR_B2B_MEMBERS).toContain(QUOTES_ROUTE)
|
|
127
127
|
})
|
|
128
|
+
|
|
129
|
+
it('marks Cards as a B2B-only route', () => {
|
|
130
|
+
expect(ROUTES_ONLY_FOR_B2B_MEMBERS).toContain(CARDS_ROUTE)
|
|
131
|
+
})
|
|
128
132
|
})
|
|
129
133
|
|
|
130
134
|
describe('getExtraMyAccountRoutes', () => {
|