@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.
@@ -1,9 +1,9 @@
1
1
 
2
- > @faststore/core@4.7.0-dev.0 generate /home/runner/work/faststore/faststore/packages/core
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.0 gen-types /home/runner/work/faststore/faststore/packages/core
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
  [STARTED] Parse Configuration
@@ -19,7 +19,7 @@
19
19
  [COMPLETED] Generate to /home/runner/work/faststore/faststore/packages/core/@generated/
20
20
  [COMPLETED] Generate outputs
21
21
 
22
- > @faststore/core@4.7.0-dev.0 cache-graphql /home/runner/work/faststore/faststore/packages/core
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
@@ -1,5 +1,5 @@
1
1
 
2
- > @faststore/core@4.7.0-dev.0 test /home/runner/work/faststore/faststore/packages/core
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
+ ✓  browser  test/sdk/ui/useScrollRestoration.browser.test.ts (43 tests) 1015ms
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
- ✓  browser  test/sdk/ui/useScrollRestoration.browser.test.ts (43 tests) 1074ms
14
- ✓  browser  test/components/account/ContractSwitcher.browser.test.tsx (13 tests) 3025ms
15
- ✓ shows an error state when the list fails to load  785ms
16
- ✓ requires selecting a contract before Confirm is enabled, then switches (REQ-03)  417ms
17
- ✓ keeps Confirm disabled until a different contract is selected  304ms
18
- ✓ does not reload when the switch returns false  321ms
19
- ✓  browser  test/components/account/cards/MyAccountListCards.browser.test.tsx (14 tests) 2288ms
20
- ✓ shows the tab bar and renders Personal cards by default  1203ms
21
- ✓ paginates when there are more than 25 cards  309ms
22
- ✓  browser  test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx (8 tests) 148ms
23
- ✓  browser  test/sdk/session/reconcileSessionLocale.browser.test.ts (5 tests) 27ms
14
+ ✓  browser  test/components/account/cards/MyAccountListCards.browser.test.tsx (14 tests) 2045ms
15
+ ✓ shows the tab bar and renders Personal cards by default  821ms
16
+ ✓ paginates when there are more than 25 cards  327ms
17
+ ✓  browser  test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx (8 tests) 216ms
18
+ ✓  browser  test/components/account/ContractSwitcher.browser.test.tsx (13 tests) 2517ms
19
+ ✓ shows an error state when the list fails to load  773ms
20
+ ✓ requires selecting a contract before Confirm is enabled, then switches (REQ-03)  391ms
21
+ ✓ keeps Confirm disabled until a different contract is selected  338ms
22
+ ✓  browser  test/sdk/session/reconcileSessionLocale.browser.test.ts (5 tests) 33ms
23
+ ✓  browser  test/sdk/recommendations/useRecommendationShelf.browser.test.tsx (10 tests) 124ms
24
24
  stderr | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx
25
25
  Error in optimistic validation: TypeError: Failed to parse URL from /api/graphql?operationName=ValidateCartMutation&operationHash=3c71b0d3fc2bade14df68abfa271858beb361b12
26
26
   at node:internal/deps/undici/undici:16416:13
@@ -50,8 +50,8 @@ Browserslist: browsers data (caniuse-lite) is 6 months old. Please run:
50
50
  stderr | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx > RecommendationShelf > renders nothing when there is an error
51
51
  Error fetching recommendations undefined boom for campaign vrn:recommendations:acc:rec-top-items-v2:campaign-1
52
52
 
53
- ✓  browser  test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx (8 tests) 307ms
54
- ✓  browser  test/sdk/recommendations/useRecommendationShelf.browser.test.tsx (10 tests) 152ms
53
+ ✓  browser  test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx (8 tests) 115ms
54
+ ✓  browser  test/sdk/session/getInitialSession.browser.test.ts (6 tests) 22ms
55
55
  stderr | test/pages/password-protection.browser.test.tsx > PasswordProtectionLogin > posts the password and redirects to the requested return path
56
56
  Warning: 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
+ ✓  browser  test/components/account/OrganizationDrawer.browser.test.tsx (5 tests) 1169ms
189
+ ✓ renders the menu view with contract details and manage footer  632ms
188
190
  stderr | test/pages/password-protection.browser.test.tsx > PasswordProtectionLogin > shows service unavailable when the response is not a login payload
189
191
  Warning: 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
- ✓  browser  test/pages/password-protection.browser.test.tsx (6 tests) 1261ms
285
- ✓ renders the password protection form  642ms
286
- ✓  browser  test/components/account/OrganizationDrawer.browser.test.tsx (5 tests) 1051ms
287
- ✓ renders the menu view with contract details and manage footer  559ms
288
- ✓  browser  test/sdk/session/getInitialSession.browser.test.ts (6 tests) 13ms
289
- ✓  browser  test/sdk/account/changeContractToken.browser.test.ts (9 tests) 54ms
290
- ✓  browser  test/sdk/account/useAvailableContracts.browser.test.ts (6 tests) 40ms
286
+ ✓  browser  test/pages/password-protection.browser.test.tsx (6 tests) 1239ms
287
+ ✓ renders the password protection form  640ms
288
+ ✓  browser  test/sdk/account/changeContractToken.browser.test.ts (9 tests) 28ms
291
289
  stderr | test/sdk/localization/store-url.browser.test.ts
292
290
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
293
291
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -297,8 +295,9 @@ This ensures that you're testing the behavior the user would see in the browser.
297
295
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
298
296
 
299
297
  ✓  browser  test/sdk/localization/store-url.browser.test.ts (3 tests) 5ms
300
- ✓  browser  test/components/templates/SearchPage/SearchWrapper.browser.test.tsx (3 tests) 48ms
301
- ✓  browser  test/sdk/account/useSwitchContract.browser.test.ts (4 tests) 43ms
298
+ ✓  browser  test/sdk/account/useAvailableContracts.browser.test.ts (6 tests) 36ms
299
+ ✓  browser  test/components/templates/SearchPage/SearchWrapper.browser.test.tsx (3 tests) 39ms
300
+ ✓  browser  test/sdk/account/useSwitchContract.browser.test.ts (4 tests) 27ms
302
301
  stderr | test/components/account/doLogout.browser.test.ts
303
302
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
304
303
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -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
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
309
308
 
310
- ✓  browser  test/components/account/doLogout.browser.test.ts (1 test) 24ms
311
- ✓  browser  test/components/sections/Account/AccountListCards.browser.test.tsx (3 tests) 83ms
312
- ✓  browser  test/components/account/OrganizationDrawerHeader.browser.test.tsx (3 tests) 247ms
313
- ✓  browser  test/components/account/OrganizationDrawerFooter.browser.test.tsx (3 tests) 222ms
309
+ ✓  browser  test/components/account/doLogout.browser.test.ts (1 test) 31ms
310
+ ✓  browser  test/components/sections/Account/AccountListCards.browser.test.tsx (3 tests) 82ms
311
+ ✓  browser  test/components/account/OrganizationDrawerHeader.browser.test.tsx (3 tests) 273ms
312
+ ✓  browser  test/components/account/OrganizationDrawerFooter.browser.test.tsx (3 tests) 281ms
314
313
  stderr | test/sdk/account/clearPersistedSessionState.browser.test.ts
315
314
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
316
315
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -320,11 +319,11 @@ This ensures that you're testing the behavior the user would see in the browser.
320
319
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
321
320
 
322
321
  ✓  browser  test/sdk/account/clearPersistedSessionState.browser.test.ts (1 test) 8ms
323
- ✓  browser  test/utils/isLocalHost.browser.test.ts (3 tests) 4ms
322
+ ✓  browser  test/utils/isLocalHost.browser.test.ts (3 tests) 5ms
324
323
  ✓  browser  test/sdk/session/reconcileSessionLocale.disabled.browser.test.ts (1 test) 3ms
325
- ✓  node  test/utils/localization/bindingPaths.test.ts (71 tests) 27ms
326
- ✓  browser  test/components/skeletons/ProductGridSkeleton.browser.test.tsx (2 tests) 42ms
327
- ✓  node  test/server/password-protection-service.test.ts (22 tests) 33ms
324
+ ✓  node  test/utils/localization/bindingPaths.test.ts (71 tests) 25ms
325
+ ✓  browser  test/components/skeletons/ProductGridSkeleton.browser.test.tsx (2 tests) 40ms
326
+ ✓  node  test/server/password-protection-service.test.ts (22 tests) 43ms
328
327
  stderr | test/sdk/account/refreshToken.browser.test.ts
329
328
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
330
329
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -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
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
335
334
 
335
+ ✓  node  test/utils/match-url.test.ts (10 tests) 8ms
336
336
  ✓  browser  test/sdk/account/refreshToken.browser.test.ts (1 test) 5ms
337
- ✓  node  test/utils/match-url.test.ts (10 tests) 10ms
338
- ✓  node  test/pages/api/unlock.test.ts (15 tests) 179ms
339
- ✓  node  test/sdk/localization/useBindingSelector.test.tsx (22 tests) 14ms
340
- ✓  node  test/sdk/localization/bindingSelector.test.ts (18 tests) 6ms
337
+ ✓  node  test/sdk/localization/useBindingSelector.test.tsx (22 tests) 15ms
338
+ ✓  node  test/pages/api/unlock.test.ts (15 tests) 154ms
339
+ ✓  node  test/sdk/localization/bindingSelector.test.ts (18 tests) 8ms
341
340
  stderr | test/components/search/SearchInputComponent.test.tsx
342
341
  Warning: 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
- ✓  node  test/components/search/SearchInputComponent.test.tsx (6 tests) 69ms
405
- ✓  node  test/sdk/search/useSearchHistory.test.ts (13 tests) 40ms
406
- ✓  node  test/utils/cookieCacheBusting.test.ts (10 tests) 11ms
407
- ✓  node  test/utils/clearCookies.test.ts (20 tests) 22ms
403
+ ✓  node  test/components/search/SearchInputComponent.test.tsx (6 tests) 73ms
404
+ ✓  node  test/sdk/search/useSearchHistory.test.ts (13 tests) 54ms
405
+ ✓  node  test/utils/cookieCacheBusting.test.ts (10 tests) 12ms
408
406
  stderr | test/pages/pvt/account/cards/index.test.ts > Cards page getServerSideProps > redirects to /pvt/account/403 when the query fails with 401/403
409
407
  { extensions: { status: 401 } }
410
408
 
411
409
  stderr | test/pages/pvt/account/cards/index.test.ts > Cards page getServerSideProps > renders the error state (no redirect) when the query fails with a non-auth status
412
410
  { extensions: { status: 502 } }
413
411
 
414
- ✓  node  test/pages/pvt/account/cards/index.test.ts (8 tests) 12ms
415
- ✓  node  test/experimental/myAccountCmsServerSideProps.test.ts (5 tests) 9ms
416
- ✓  node  test/components/quotes/MyAccountListQuotesTable.test.tsx (12 tests) 402ms
412
+ ✓  node  test/pages/pvt/account/cards/index.test.ts (8 tests) 11ms
413
+ ✓  node  test/utils/clearCookies.test.ts (20 tests) 27ms
414
+ ✓  node  test/experimental/myAccountCmsServerSideProps.test.ts (5 tests) 10ms
415
+ ✓  node  test/components/quotes/MyAccountListQuotesTable.test.tsx (12 tests) 390ms
417
416
  stderr | test/pages/api/graphql.test.ts > /api/graphql error status propagation > propagates the upstream 400 from a wrapped BadRequestError instead of 500
418
417
  Graphql 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/.pnpm/@vitest+runner@4.0.18/node_modules/@vitest/runner/dist/index.js:1653:37
507
506
  at Traces.$ (file:///home/runner/work/faststore/faststore/node_modules/.pnpm/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/vitest/dist/chunks/traces.CCmnQaNT.js:142:27)
508
507
 
509
- ✓  node  test/pages/api/graphql.test.ts (17 tests) 21ms
508
+ ✓  node  test/pages/api/graphql.test.ts (17 tests) 22ms
509
+ ✓  node  test/components/quotes/MyAccountListQuotes.test.tsx (9 tests) 840ms
510
+ ✓ navigates with the search term on blur  360ms
511
+ ✓ navigates without a label param when the search is cleared  361ms
510
512
  stderr | test/sdk/account/useSetPassword.test.ts > useSetPassword > maps wrongcredentials error responses to the existing message
511
513
  Set password request failed: Bad Request
512
514
 
513
- ✓  node  test/sdk/account/useSetPassword.test.ts (6 tests) 26ms
514
- ✓  node  test/components/quotes/MyAccountListQuotes.test.tsx (9 tests) 849ms
515
- ✓ navigates with the search term on blur  363ms
516
- ✓ navigates without a label param when the search is cleared  368ms
517
- ✓  node  test/components/quotes/quoteFilters.test.ts (23 tests) 38ms
515
+ ✓  node  test/sdk/account/useSetPassword.test.ts (6 tests) 44ms
516
+ ✓  node  test/components/quotes/quoteFilters.test.ts (23 tests) 37ms
517
+ ✓  node  test/sdk/orderEntry/useOrderEntryOperation.test.ts (8 tests) 38ms
518
518
  ✓  node  test/utils/multipleTemplates.test.ts (8 tests) 5ms
519
- ✓  node  test/sdk/orderEntry/useOrderEntryOperation.test.ts (8 tests) 39ms
520
- ✓  node  test/utils/localization/localizeRedirectDestination.test.ts (11 tests) 5ms
521
- ✓  node  test/sdk/orderEntry/useOrderEntryUpload.test.ts (8 tests) 50ms
522
- ✓  node  test/sdk/account/getMyAccountRoutes.test.ts (11 tests) 9ms
523
- ✓  node  test/components/quotes/MyAccountQuotesFilterSlider.test.tsx (5 tests) 157ms
524
- ✓  node  test/sdk/analytics/useStartRecommendationSession.test.ts (6 tests) 36ms
525
- ✓  node  test/sdk/orderEntry/useOrderEntry.test.ts (8 tests) 29ms
526
- ✓  node  test/proxy.localization.test.ts (5 tests) 27ms
527
- ✓  node  test/server/index.test.ts (7 tests) 1102ms
528
- ✓ should return a valid merged GraphQL schema  312ms
529
- ✓ should handle options and execute  566ms
530
- ✓  node  test/sdk/session/syncSalesChannelFromOrderForm.test.ts (6 tests) 6ms
531
- ✓  node  test/proxy.test.ts (4 tests) 32ms
532
- ✓  node  test/server/webops-api.test.ts (9 tests) 18ms
533
- ✓  node  test/components/quotes/MyAccountQuotesSelectedTags.test.tsx (8 tests) 112ms
519
+ ✓  node  test/utils/localization/localizeRedirectDestination.test.ts (11 tests) 7ms
520
+ ✓  node  test/sdk/account/getMyAccountRoutes.test.ts (12 tests) 9ms
521
+ ✓  node  test/sdk/orderEntry/useOrderEntryUpload.test.ts (8 tests) 48ms
522
+ ✓  node  test/components/quotes/MyAccountQuotesFilterSlider.test.tsx (5 tests) 129ms
523
+ ✓  node  test/sdk/analytics/useStartRecommendationSession.test.ts (6 tests) 47ms
524
+ ✓  node  test/proxy.localization.test.ts (5 tests) 26ms
525
+ ✓  node  test/sdk/orderEntry/useOrderEntry.test.ts (8 tests) 25ms
526
+ ✓  node  test/server/index.test.ts (7 tests) 1128ms
527
+ ✓ should handle options and execute  605ms
528
+ ✓  node  test/sdk/session/syncSalesChannelFromOrderForm.test.ts (6 tests) 10ms
529
+ ✓  node  test/proxy.test.ts (4 tests) 18ms
530
+ ✓  node  test/server/webops-api.test.ts (9 tests) 28ms
531
+ ✓  node  test/components/quotes/MyAccountQuotesSelectedTags.test.tsx (8 tests) 91ms
534
532
  ✓  node  test/sdk/cart/waitForSessionValidated.test.ts (5 tests) 12ms
533
+ ✓  node  test/sdk/orderEntry/useOrderFormItems.test.ts (7 tests) 41ms
535
534
  ✓  node  test/server/content/service.test.ts (5 tests) 5ms
536
- ✓  node  test/sdk/orderEntry/useOrderFormItems.test.ts (7 tests) 26ms
537
- ✓  node  test/server/cms/global.test.ts (3 tests) 4ms
538
535
  ✓  node  test/sdk/account/refreshToken.test.ts (5 tests) 7ms
536
+ ✓  node  test/server/cms/global.test.ts (3 tests) 6ms
539
537
  ✓  node  test/sdk/localization/store-url.test.ts (1 test) 4ms
540
- ✓  node  test/sdk/auth/useAuth.test.ts (5 tests) 36ms
538
+ ✓  node  test/sdk/auth/useAuth.test.ts (5 tests) 20ms
539
+ ✓  node  test/components/quotes/MyAccountQuotesStatusSelector.test.tsx (6 tests) 129ms
541
540
  ✓  node  test/sdk/analytics/hasEnabledRecommendationShelf.test.ts (6 tests) 5ms
542
- ✓  node  test/components/quotes/MyAccountQuotesStatusSelector.test.tsx (6 tests) 131ms
543
- ✓  node  test/utils/getRequestHostname.test.ts (12 tests) 6ms
544
- ✓  node  test/pages/api/preview.test.ts (2 tests) 13ms
545
- ✓  node  test/components/search/SearchInput.test.ts (6 tests) 11ms
541
+ ✓  node  test/utils/getRequestHostname.test.ts (12 tests) 5ms
542
+ ✓  node  test/server/rootSpan.test.ts (4 tests) 48ms
543
+ ✓  node  test/components/account/Layout.test.tsx (6 tests) 70ms
544
+ ✓  node  test/pages/api/preview.test.ts (2 tests) 9ms
546
545
  ✓  node  test/utils/validateSessionRefreshToken.test.ts (6 tests) 5ms
547
- ✓  node  test/server/rootSpan.test.ts (4 tests) 38ms
546
+ ✓  node  test/components/search/SearchInput.test.ts (6 tests) 7ms
548
547
  ✓  node  test/sdk/recommendations/vrn.test.ts (5 tests) 4ms
549
- ✓  node  test/server/cms/index.test.ts (2 tests) 5ms
550
- ✓  node  test/utils/retry.test.ts (5 tests) 10ms
551
- ✓  node  test/components/account/Layout.test.tsx (4 tests) 52ms
552
- ✓  node  test/sdk/recommendations/useRecommendationUserId.test.ts (4 tests) 195ms
553
- ✓  node  test/sdk/account/getB2BSessionClaims.test.ts (4 tests) 5ms
554
- ✓  node  test/utils/unlockResponse.test.ts (11 tests) 6ms
555
- ✓  node  test/server/cms/myAccountDefaultSections.test.ts (5 tests) 4ms
556
- ✓  node  test/sdk/recommendations/useRecommendations.test.ts (2 tests) 4ms
548
+ ✓  node  test/utils/retry.test.ts (5 tests) 16ms
549
+ ✓  node  test/server/cms/index.test.ts (2 tests) 8ms
550
+ ✓  node  test/sdk/account/getB2BSessionClaims.test.ts (4 tests) 4ms
551
+ ✓  node  test/utils/unlockResponse.test.ts (11 tests) 4ms
552
+ ✓  node  test/server/cms/myAccountDefaultSections.test.ts (5 tests) 5ms
553
+ ✓  node  test/sdk/recommendations/useRecommendationUserId.test.ts (4 tests) 189ms
554
+ ✓  node  test/sdk/recommendations/useRecommendations.test.ts (2 tests) 5ms
555
+ ✓  node  test/components/account/OrganizationDrawerBody.test.tsx (3 tests) 41ms
557
556
  ✓  node  test/utils/isLocalHost.test.ts (7 tests) 5ms
558
- ✓  node  test/components/account/OrganizationDrawerBody.test.tsx (3 tests) 45ms
559
- ✓  node  test/utils/userOrderStatus.test.ts (3 tests) 3ms
560
- ✓  node  test/utils/getCookie.test.ts (4 tests) 5ms
561
- ✓  node  test/sdk/analytics/utils.test.ts (2 tests) 3ms
562
- ✓  node  test/components/auth/ProfileChallenge.test.tsx (3 tests) 27ms
563
- ✓  node  test/instrumentation.test.ts (3 tests) 6ms
564
- ✓  node  test/sdk/account/clearPersistedSessionState.test.ts (1 test) 14ms
565
- ✓  node  test/components/quotes/MyAccountQuoteStatusBadge.test.tsx (2 tests) 32ms
557
+ ✓  node  test/utils/userOrderStatus.test.ts (3 tests) 4ms
558
+ ✓  node  test/utils/getCookie.test.ts (4 tests) 3ms
559
+ ✓  node  test/sdk/analytics/utils.test.ts (2 tests) 4ms
560
+ ✓  node  test/instrumentation.test.ts (3 tests) 4ms
561
+ ✓  node  test/components/auth/ProfileChallenge.test.tsx (3 tests) 39ms
562
+ ✓  node  test/sdk/account/clearPersistedSessionState.test.ts (1 test) 10ms
563
+ ✓  node  test/components/quotes/MyAccountQuoteStatusBadge.test.tsx (2 tests) 23ms
566
564
 
567
565
   Test Files  87 passed (87)
568
-  Tests  695 passed (695)
569
-  Start at  16:20:18
570
-  Duration  41.11s (transform 10.74s, setup 0ms, import 35.89s, tests 14.30s, environment 51.43s)
566
+  Tests  698 passed (698)
567
+  Start at  17:40:10
568
+  Duration  39.18s (transform 11.25s, setup 0ms, import 34.85s, tests 13.48s, environment 48.59s)
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.1",
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.1",
75
- "@faststore/diagnostics": "4.7.0-dev.1",
76
- "@faststore/lighthouse": "4.7.0-dev.1",
77
- "@faststore/sdk": "4.7.0-dev.1",
78
- "@faststore/ui": "4.7.0-dev.1"
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 never route-gated here: `useAdHocCard` only affects the
39
- // Personal-tab rendering inside the page itself (spec
40
- // my-account-cards-gating-plan), so it never joins
41
- // ROUTES_ONLY_FOR_B2B_MEMBERS — the sidebar entry always stays visible.
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/403 when the query fails with 401/403', async () => {
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: false,
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('never gates the route: canViewPersonalCards is false but no redirect happens', async () => {
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
- it('keeps personal cards in the payload when there is no org association, even though canViewPersonalCards is false (FR-7: B2C buyers are never subject to this check)', async () => {
169
- mockGetB2BSessionClaims.mockReturnValueOnce({
170
- hasOrgAssociation: false,
171
- hasCustomerId: false,
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', () => {