@faststore/core 4.7.0-dev.1 → 4.7.0-dev.3
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 +88 -90
- package/CHANGELOG.md +10 -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.2 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.2 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.2 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.2 test /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> vitest run
|
|
4
4
|
|
|
5
5
|
|
|
@@ -7,20 +7,20 @@
|
|
|
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 1015[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
|
-
|
|
17
|
-
|
|
18
|
-
[33m[2m✓[22m[39m
|
|
19
|
-
|
|
20
|
-
[33m[2m✓[22m[39m
|
|
21
|
-
|
|
22
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
23
|
-
[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
|
|
14
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/cards/MyAccountListCards.browser.test.tsx [2m([22m[2m14 tests[22m[2m)[22m[33m 2045[2mms[22m[39m
|
|
15
|
+
[33m[2m✓[22m[39m shows the tab bar and renders Personal cards by default [33m 821[2mms[22m[39m
|
|
16
|
+
[33m[2m✓[22m[39m paginates when there are more than 25 cards [33m 327[2mms[22m[39m
|
|
17
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 216[2mms[22m[39m
|
|
18
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/ContractSwitcher.browser.test.tsx [2m([22m[2m13 tests[22m[2m)[22m[33m 2517[2mms[22m[39m
|
|
19
|
+
[33m[2m✓[22m[39m shows an error state when the list fails to load [33m 773[2mms[22m[39m
|
|
20
|
+
[33m[2m✓[22m[39m requires selecting a contract before Confirm is enabled, then switches (REQ-03) [33m 391[2mms[22m[39m
|
|
21
|
+
[33m[2m✓[22m[39m keeps Confirm disabled until a different contract is selected [33m 338[2mms[22m[39m
|
|
22
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/reconcileSessionLocale.browser.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 33[2mms[22m[39m
|
|
23
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/recommendations/useRecommendationShelf.browser.test.tsx [2m([22m[2m10 tests[22m[2m)[22m[32m 124[2mms[22m[39m
|
|
24
24
|
[90mstderr[2m | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx
|
|
25
25
|
[22m[39mError in optimistic validation: TypeError: Failed to parse URL from /api/graphql?operationName=ValidateCartMutation&operationHash=3c71b0d3fc2bade14df68abfa271858beb361b12
|
|
26
26
|
[90m at node:internal/deps/undici/undici:16416:13[39m
|
|
@@ -50,8 +50,8 @@ Browserslist: browsers data (caniuse-lite) is 6 months old. Please run:
|
|
|
50
50
|
[90mstderr[2m | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx[2m > [22m[2mRecommendationShelf[2m > [22m[2mrenders nothing when there is an error
|
|
51
51
|
[22m[39mError fetching recommendations [90mundefined[39m boom for campaign vrn:recommendations:acc:rec-top-items-v2:campaign-1
|
|
52
52
|
|
|
53
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[
|
|
54
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/
|
|
53
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 115[2mms[22m[39m
|
|
54
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/getInitialSession.browser.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 22[2mms[22m[39m
|
|
55
55
|
[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
56
|
[22m[39mWarning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
|
|
57
57
|
|
|
@@ -185,6 +185,8 @@ act(() => {
|
|
|
185
185
|
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
|
|
186
186
|
at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
|
|
187
187
|
|
|
188
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawer.browser.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[33m 1169[2mms[22m[39m
|
|
189
|
+
[33m[2m✓[22m[39m renders the menu view with contract details and manage footer [33m 632[2mms[22m[39m
|
|
188
190
|
[90mstderr[2m | test/pages/password-protection.browser.test.tsx[2m > [22m[2mPasswordProtectionLogin[2m > [22m[2mshows service unavailable when the response is not a login payload
|
|
189
191
|
[22m[39mWarning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
|
|
190
192
|
|
|
@@ -281,13 +283,9 @@ act(() => {
|
|
|
281
283
|
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
284
|
at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
|
|
283
285
|
|
|
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
|
-
[33m[2m✓[22m[39m renders the menu view with contract details and manage footer [33m 559[2mms[22m[39m
|
|
288
|
-
[32m✓[39m [30m[46m browser [49m[39m test/sdk/session/getInitialSession.browser.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
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
|
|
286
|
+
[32m✓[39m [30m[46m browser [49m[39m test/pages/password-protection.browser.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[33m 1239[2mms[22m[39m
|
|
287
|
+
[33m[2m✓[22m[39m renders the password protection form [33m 640[2mms[22m[39m
|
|
288
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/changeContractToken.browser.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 28[2mms[22m[39m
|
|
291
289
|
[90mstderr[2m | test/sdk/localization/store-url.browser.test.ts
|
|
292
290
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
293
291
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -297,8 +295,9 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
297
295
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
298
296
|
|
|
299
297
|
[32m✓[39m [30m[46m browser [49m[39m test/sdk/localization/store-url.browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
300
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
301
|
-
[32m✓[39m [30m[46m browser [49m[39m test/
|
|
298
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/useAvailableContracts.browser.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 36[2mms[22m[39m
|
|
299
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/templates/SearchPage/SearchWrapper.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 39[2mms[22m[39m
|
|
300
|
+
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/useSwitchContract.browser.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 27[2mms[22m[39m
|
|
302
301
|
[90mstderr[2m | test/components/account/doLogout.browser.test.ts
|
|
303
302
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
304
303
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -307,10 +306,10 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
307
306
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
|
|
308
307
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
309
308
|
|
|
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
|
|
309
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/doLogout.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 31[2mms[22m[39m
|
|
310
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/sections/Account/AccountListCards.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 82[2mms[22m[39m
|
|
311
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawerHeader.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 273[2mms[22m[39m
|
|
312
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/account/OrganizationDrawerFooter.browser.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 281[2mms[22m[39m
|
|
314
313
|
[90mstderr[2m | test/sdk/account/clearPersistedSessionState.browser.test.ts
|
|
315
314
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
316
315
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -320,11 +319,11 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
320
319
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
321
320
|
|
|
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
|
|
322
|
+
[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
|
|
324
323
|
[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
|
|
326
|
-
[32m✓[39m [30m[46m browser [49m[39m test/components/skeletons/ProductGridSkeleton.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
327
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/password-protection-service.test.ts [2m([22m[2m22 tests[22m[2m)[22m[32m
|
|
324
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/localization/bindingPaths.test.ts [2m([22m[2m71 tests[22m[2m)[22m[32m 25[2mms[22m[39m
|
|
325
|
+
[32m✓[39m [30m[46m browser [49m[39m test/components/skeletons/ProductGridSkeleton.browser.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 40[2mms[22m[39m
|
|
326
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/password-protection-service.test.ts [2m([22m[2m22 tests[22m[2m)[22m[32m 43[2mms[22m[39m
|
|
328
327
|
[90mstderr[2m | test/sdk/account/refreshToken.browser.test.ts
|
|
329
328
|
[22m[39mError in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
|
|
330
329
|
at waitForSessionValidated [90m(/home/runner/work/faststore/faststore/packages/core/[39msrc/sdk/cart/waitForSessionValidated.ts:16:32[90m)[39m
|
|
@@ -333,11 +332,11 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
333
332
|
at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
|
|
334
333
|
[90m at processTicksAndRejections (node:internal/process/task_queues:103:5)[39m
|
|
335
334
|
|
|
335
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/match-url.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
336
336
|
[32m✓[39m [30m[46m browser [49m[39m test/sdk/account/refreshToken.browser.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
337
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
338
|
-
[32m✓[39m [30m[43m node [49m[39m test/pages/api/unlock.test.ts [2m([22m[2m15 tests[22m[2m)[22m[32m
|
|
339
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/
|
|
340
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/bindingSelector.test.ts [2m([22m[2m18 tests[22m[2m)[22m[32m 6[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 15[2mms[22m[39m
|
|
338
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/unlock.test.ts [2m([22m[2m15 tests[22m[2m)[22m[32m 154[2mms[22m[39m
|
|
339
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/localization/bindingSelector.test.ts [2m([22m[2m18 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
341
340
|
[90mstderr[2m | test/components/search/SearchInputComponent.test.tsx
|
|
342
341
|
[22m[39mWarning: forwardRef render functions accept exactly two parameters: props and ref. Did you forget to use the ref parameter?
|
|
343
342
|
|
|
@@ -401,19 +400,19 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
|
|
|
401
400
|
at Suspense
|
|
402
401
|
at Wrapper (/home/runner/work/faststore/faststore/packages/core/test/components/search/SearchInputComponent.test.tsx:106:20)
|
|
403
402
|
|
|
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
|
|
403
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/search/SearchInputComponent.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m 73[2mms[22m[39m
|
|
404
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/search/useSearchHistory.test.ts [2m([22m[2m13 tests[22m[2m)[22m[32m 54[2mms[22m[39m
|
|
405
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/cookieCacheBusting.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
408
406
|
[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
407
|
[22m[39m{ extensions: { status: [33m401[39m } }
|
|
410
408
|
|
|
411
409
|
[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
410
|
[22m[39m{ extensions: { status: [33m502[39m } }
|
|
413
411
|
|
|
414
|
-
[32m✓[39m [30m[43m node [49m[39m test/pages/pvt/account/cards/index.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
415
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
416
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
412
|
+
[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
|
|
413
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/clearCookies.test.ts [2m([22m[2m20 tests[22m[2m)[22m[32m 27[2mms[22m[39m
|
|
414
|
+
[32m✓[39m [30m[43m node [49m[39m test/experimental/myAccountCmsServerSideProps.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
415
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountListQuotesTable.test.tsx [2m([22m[2m12 tests[22m[2m)[22m[33m 390[2mms[22m[39m
|
|
417
416
|
[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
417
|
[22m[39mGraphql execution returned with error: [
|
|
419
418
|
{
|
|
@@ -506,66 +505,65 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
|
|
|
506
505
|
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
506
|
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
507
|
|
|
509
|
-
[32m✓[39m [30m[43m node [49m[39m test/pages/api/graphql.test.ts [2m([22m[2m17 tests[22m[2m)[22m[32m
|
|
508
|
+
[32m✓[39m [30m[43m node [49m[39m test/pages/api/graphql.test.ts [2m([22m[2m17 tests[22m[2m)[22m[32m 22[2mms[22m[39m
|
|
509
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountListQuotes.test.tsx [2m([22m[2m9 tests[22m[2m)[22m[33m 840[2mms[22m[39m
|
|
510
|
+
[33m[2m✓[22m[39m navigates with the search term on blur [33m 360[2mms[22m[39m
|
|
511
|
+
[33m[2m✓[22m[39m navigates without a label param when the search is cleared [33m 361[2mms[22m[39m
|
|
510
512
|
[90mstderr[2m | test/sdk/account/useSetPassword.test.ts[2m > [22m[2museSetPassword[2m > [22m[2mmaps wrongcredentials error responses to the existing message
|
|
511
513
|
[22m[39mSet password request failed: Bad Request
|
|
512
514
|
|
|
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/
|
|
515
|
-
|
|
516
|
-
[33m[2m✓[22m[39m navigates without a label param when the search is cleared [33m 368[2mms[22m[39m
|
|
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
|
|
515
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/useSetPassword.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 44[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 37[2mms[22m[39m
|
|
517
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntryOperation.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 38[2mms[22m[39m
|
|
518
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
|
|
519
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
520
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
521
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntryUpload.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
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/
|
|
525
|
-
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderEntry.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
526
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
527
|
-
|
|
528
|
-
|
|
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/server/webops-api.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 18[2mms[22m[39m
|
|
533
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesSelectedTags.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 112[2mms[22m[39m
|
|
519
|
+
[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
|
|
520
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/getMyAccountRoutes.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
521
|
+
[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
|
|
522
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesFilterSlider.test.tsx [2m([22m[2m5 tests[22m[2m)[22m[32m 129[2mms[22m[39m
|
|
523
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/analytics/useStartRecommendationSession.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 47[2mms[22m[39m
|
|
524
|
+
[32m✓[39m [30m[43m node [49m[39m test/proxy.localization.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 26[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 25[2mms[22m[39m
|
|
526
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/index.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 1128[2mms[22m[39m
|
|
527
|
+
[33m[2m✓[22m[39m should handle options and execute [33m 605[2mms[22m[39m
|
|
528
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/session/syncSalesChannelFromOrderForm.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
529
|
+
[32m✓[39m [30m[43m node [49m[39m test/proxy.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 18[2mms[22m[39m
|
|
530
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/webops-api.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 28[2mms[22m[39m
|
|
531
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesSelectedTags.test.tsx [2m([22m[2m8 tests[22m[2m)[22m[32m 91[2mms[22m[39m
|
|
534
532
|
[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
|
|
533
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/orderEntry/useOrderFormItems.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 41[2mms[22m[39m
|
|
535
534
|
[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 26[2mms[22m[39m
|
|
537
|
-
[32m✓[39m [30m[43m node [49m[39m test/server/cms/global.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
538
535
|
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/refreshToken.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
536
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/cms/global.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
539
537
|
[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
|
|
538
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/auth/useAuth.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 20[2mms[22m[39m
|
|
539
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuotesStatusSelector.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m 129[2mms[22m[39m
|
|
541
540
|
[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/
|
|
543
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
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/utils/getRequestHostname.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
542
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/rootSpan.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 48[2mms[22m[39m
|
|
543
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/account/Layout.test.tsx [2m([22m[2m6 tests[22m[2m)[22m[32m 70[2mms[22m[39m
|
|
544
|
+
[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
|
|
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/
|
|
546
|
+
[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
|
|
548
547
|
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/vrn.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
549
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
550
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
551
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
552
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
553
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
554
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
555
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
556
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
548
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/retry.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 16[2mms[22m[39m
|
|
549
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/cms/index.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
550
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/account/getB2BSessionClaims.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
551
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/unlockResponse.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
552
|
+
[32m✓[39m [30m[43m node [49m[39m test/server/cms/myAccountDefaultSections.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
553
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/useRecommendationUserId.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 189[2mms[22m[39m
|
|
554
|
+
[32m✓[39m [30m[43m node [49m[39m test/sdk/recommendations/useRecommendations.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
555
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/account/OrganizationDrawerBody.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 41[2mms[22m[39m
|
|
557
556
|
[32m✓[39m [30m[43m node [49m[39m test/utils/isLocalHost.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
558
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
559
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils/
|
|
560
|
-
[32m✓[39m [30m[43m node [49m[39m test/utils
|
|
561
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
562
|
-
[32m✓[39m [30m[43m node [49m[39m test/components/auth/ProfileChallenge.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
563
|
-
[32m✓[39m [30m[43m node [49m[39m test/
|
|
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 32[2mms[22m[39m
|
|
557
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/userOrderStatus.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
558
|
+
[32m✓[39m [30m[43m node [49m[39m test/utils/getCookie.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
559
|
+
[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
|
|
560
|
+
[32m✓[39m [30m[43m node [49m[39m test/instrumentation.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
561
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/auth/ProfileChallenge.test.tsx [2m([22m[2m3 tests[22m[2m)[22m[32m 39[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
|
|
563
|
+
[32m✓[39m [30m[43m node [49m[39m test/components/quotes/MyAccountQuoteStatusBadge.test.tsx [2m([22m[2m2 tests[22m[2m)[22m[32m 23[2mms[22m[39m
|
|
566
564
|
|
|
567
565
|
[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
|
|
566
|
+
[2m Tests [22m [1m[32m698 passed[39m[22m[90m (698)[39m
|
|
567
|
+
[2m Start at [22m 17:40:10
|
|
568
|
+
[2m Duration [22m 39.18s[2m (transform 11.25s, setup 0ms, import 34.85s, tests 13.48s, environment 48.59s)[22m
|
|
571
569
|
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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.3](https://github.com/vtex/faststore/compare/v4.7.0-dev.2...v4.7.0-dev.3) (2026-08-25)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @faststore/core
|
|
9
|
+
|
|
10
|
+
# [4.7.0-dev.2](https://github.com/vtex/faststore/compare/v4.7.0-dev.1...v4.7.0-dev.2) (2026-08-24)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- 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)
|
|
15
|
+
|
|
6
16
|
# [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
17
|
|
|
8
18
|
**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.3",
|
|
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/
|
|
76
|
-
"@faststore/
|
|
77
|
-
"@faststore/
|
|
78
|
-
"@faststore/ui": "4.7.0-dev.
|
|
74
|
+
"@faststore/api": "4.7.0-dev.3",
|
|
75
|
+
"@faststore/lighthouse": "4.7.0-dev.3",
|
|
76
|
+
"@faststore/sdk": "4.7.0-dev.3",
|
|
77
|
+
"@faststore/diagnostics": "4.7.0-dev.3",
|
|
78
|
+
"@faststore/ui": "4.7.0-dev.3"
|
|
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', () => {
|