@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.
@@ -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.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.0 gen-types /home/runner/work/faststore/faststore/packages/core
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
  [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.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
@@ -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.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
+ ✓  browser  test/sdk/ui/useScrollRestoration.browser.test.ts (43 tests) 943ms
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
14
+ ✓  browser  test/components/account/ContractSwitcher.browser.test.tsx (13 tests) 2342ms
15
+ ✓ shows an error state when the list fails to load  612ms
16
+ ✓ requires selecting a contract before Confirm is enabled, then switches (REQ-03)  319ms
17
+ ✓ keeps Confirm disabled until a different contract is selected  325ms
18
+ ✓  browser  test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx (8 tests) 277ms
19
+ ✓  browser  test/components/account/cards/MyAccountListCards.browser.test.tsx (14 tests) 1907ms
20
+ ✓ shows the tab bar and renders Personal cards by default  971ms
23
21
  ✓  browser  test/sdk/session/reconcileSessionLocale.browser.test.ts (5 tests) 27ms
24
22
  stderr | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx
25
23
  Error 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
  stderr | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx > RecommendationShelf > renders nothing when there is an error
51
49
  Error fetching recommendations undefined boom for campaign vrn:recommendations:acc:rec-top-items-v2:campaign-1
52
50
 
53
- ✓  browser  test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx (8 tests) 307ms
54
- ✓  browser  test/sdk/recommendations/useRecommendationShelf.browser.test.tsx (10 tests) 152ms
51
+ ✓  browser  test/sdk/recommendations/useRecommendationShelf.browser.test.tsx (10 tests) 171ms
52
+ ✓  browser  test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx (8 tests) 223ms
53
+ ✓  browser  test/sdk/session/getInitialSession.browser.test.ts (6 tests) 17ms
55
54
  stderr | test/pages/password-protection.browser.test.tsx > PasswordProtectionLogin > posts the password and redirects to the requested return path
56
55
  Warning: 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
- ✓  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
283
+ ✓  browser  test/pages/password-protection.browser.test.tsx (6 tests) 1146ms
284
+ ✓ renders the password protection form  600ms
285
+ ✓  browser  test/sdk/account/changeContractToken.browser.test.ts (9 tests) 52ms
286
+ ✓  browser  test/components/account/OrganizationDrawer.browser.test.tsx (5 tests) 1220ms
287
+ ✓ renders the menu view with contract details and manage footer  623ms
291
288
  stderr | test/sdk/localization/store-url.browser.test.ts
292
289
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
293
290
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -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
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
298
295
 
299
- ✓  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
296
+ ✓  browser  test/sdk/localization/store-url.browser.test.ts (3 tests) 6ms
297
+ ✓  browser  test/sdk/account/useAvailableContracts.browser.test.ts (6 tests) 28ms
298
+ ✓  browser  test/components/templates/SearchPage/SearchWrapper.browser.test.tsx (3 tests) 37ms
299
+ ✓  browser  test/sdk/account/useSwitchContract.browser.test.ts (4 tests) 28ms
302
300
  stderr | test/components/account/doLogout.browser.test.ts
303
301
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
304
302
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -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
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
309
307
 
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
308
+ ✓  browser  test/components/account/doLogout.browser.test.ts (1 test) 23ms
309
+ ✓  browser  test/components/sections/Account/AccountListCards.browser.test.tsx (3 tests) 68ms
310
+ ✓  browser  test/components/account/OrganizationDrawerHeader.browser.test.tsx (3 tests) 242ms
314
311
  stderr | test/sdk/account/clearPersistedSessionState.browser.test.ts
315
312
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
316
313
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -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
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
321
318
 
319
+ ✓  browser  test/components/account/OrganizationDrawerFooter.browser.test.tsx (3 tests) 240ms
320
+ ✓  browser  test/utils/isLocalHost.browser.test.ts (3 tests) 5ms
322
321
  ✓  browser  test/sdk/account/clearPersistedSessionState.browser.test.ts (1 test) 8ms
323
- ✓  browser  test/utils/isLocalHost.browser.test.ts (3 tests) 4ms
324
322
  ✓  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
328
323
  stderr | test/sdk/account/refreshToken.browser.test.ts
329
324
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
330
325
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -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
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
335
330
 
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
331
+ ✓  browser  test/sdk/account/refreshToken.browser.test.ts (1 test) 8ms
332
+ ✓  node  test/utils/localization/bindingPaths.test.ts (71 tests) 28ms
333
+ ✓  browser  test/components/skeletons/ProductGridSkeleton.browser.test.tsx (2 tests) 32ms
334
+ ✓  node  test/utils/match-url.test.ts (10 tests) 11ms
335
+ ✓  node  test/server/password-protection-service.test.ts (22 tests) 29ms
336
+ ✓  node  test/pages/api/unlock.test.ts (15 tests) 267ms
337
+ ✓  node  test/sdk/localization/useBindingSelector.test.tsx (22 tests) 10ms
338
+ ✓  node  test/sdk/localization/bindingSelector.test.ts (18 tests) 9ms
341
339
  stderr | test/components/search/SearchInputComponent.test.tsx
342
340
  Warning: 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
- ✓  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
402
+ ✓  node  test/components/search/SearchInputComponent.test.tsx (6 tests) 78ms
403
+ ✓  node  test/sdk/search/useSearchHistory.test.ts (13 tests) 44ms
404
+ ✓  node  test/utils/cookieCacheBusting.test.ts (10 tests) 13ms
408
405
  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
406
  { extensions: { status: 401 } }
410
407
 
411
408
  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
409
  { extensions: { status: 502 } }
413
410
 
414
- ✓  node  test/pages/pvt/account/cards/index.test.ts (8 tests) 12ms
411
+ ✓  node  test/pages/pvt/account/cards/index.test.ts (8 tests) 11ms
412
+ ✓  node  test/utils/clearCookies.test.ts (20 tests) 25ms
415
413
  ✓  node  test/experimental/myAccountCmsServerSideProps.test.ts (5 tests) 9ms
416
- ✓  node  test/components/quotes/MyAccountListQuotesTable.test.tsx (12 tests) 402ms
414
+ ✓  node  test/components/quotes/MyAccountListQuotesTable.test.tsx (12 tests) 380ms
417
415
  stderr | test/pages/api/graphql.test.ts > /api/graphql error status propagation > propagates the upstream 400 from a wrapped BadRequestError instead of 500
418
416
  Graphql 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/.pnpm/@vitest+runner@4.0.18/node_modules/@vitest/runner/dist/index.js:1653:37
507
505
  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
506
 
509
- ✓  node  test/pages/api/graphql.test.ts (17 tests) 21ms
507
+ ✓  node  test/pages/api/graphql.test.ts (17 tests) 36ms
510
508
  stderr | test/sdk/account/useSetPassword.test.ts > useSetPassword > maps wrongcredentials error responses to the existing message
511
509
  Set password request failed: Bad Request
512
510
 
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
518
- ✓  node  test/utils/multipleTemplates.test.ts (8 tests) 5ms
511
+ ✓  node  test/sdk/account/useSetPassword.test.ts (6 tests) 30ms
512
+ ✓  node  test/components/quotes/MyAccountListQuotes.test.tsx (9 tests) 821ms
513
+ ✓ navigates with the search term on blur  361ms
514
+ ✓ navigates without a label param when the search is cleared  359ms
519
515
  ✓  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
534
- ✓  node  test/sdk/cart/waitForSessionValidated.test.ts (5 tests) 12ms
516
+ ✓  node  test/components/quotes/quoteFilters.test.ts (23 tests) 34ms
517
+ ✓  node  test/utils/multipleTemplates.test.ts (8 tests) 7ms
518
+ ✓  node  test/utils/localization/localizeRedirectDestination.test.ts (11 tests) 7ms
519
+ ✓  node  test/sdk/account/getMyAccountRoutes.test.ts (12 tests) 6ms
520
+ ✓  node  test/sdk/orderEntry/useOrderEntryUpload.test.ts (8 tests) 48ms
521
+ ✓  node  test/components/quotes/MyAccountQuotesFilterSlider.test.tsx (5 tests) 137ms
522
+ ✓  node  test/sdk/analytics/useStartRecommendationSession.test.ts (6 tests) 39ms
523
+ ✓  node  test/server/index.test.ts (7 tests) 916ms
524
+ ✓ should handle options and execute  385ms
525
+ ✓  node  test/sdk/orderEntry/useOrderEntry.test.ts (8 tests) 47ms
526
+ ✓  node  test/proxy.localization.test.ts (5 tests) 36ms
527
+ ✓  node  test/sdk/session/syncSalesChannelFromOrderForm.test.ts (6 tests) 8ms
528
+ ✓  node  test/proxy.test.ts (4 tests) 15ms
529
+ ✓  node  test/server/webops-api.test.ts (9 tests) 15ms
535
530
  ✓  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
- ✓  node  test/sdk/account/refreshToken.test.ts (5 tests) 7ms
531
+ ✓  node  test/sdk/orderEntry/useOrderFormItems.test.ts (7 tests) 42ms
532
+ ✓  node  test/components/quotes/MyAccountQuotesSelectedTags.test.tsx (8 tests) 110ms
533
+ ✓  node  test/sdk/account/refreshToken.test.ts (5 tests) 10ms
534
+ ✓  node  test/sdk/cart/waitForSessionValidated.test.ts (5 tests) 10ms
535
+ ✓  node  test/server/cms/global.test.ts (3 tests) 5ms
539
536
  ✓  node  test/sdk/localization/store-url.test.ts (1 test) 4ms
540
- ✓  node  test/sdk/auth/useAuth.test.ts (5 tests) 36ms
537
+ ✓  node  test/sdk/auth/useAuth.test.ts (5 tests) 29ms
538
+ ✓  node  test/components/quotes/MyAccountQuotesStatusSelector.test.tsx (6 tests) 119ms
541
539
  ✓  node  test/sdk/analytics/hasEnabledRecommendationShelf.test.ts (6 tests) 5ms
542
- ✓  node  test/components/quotes/MyAccountQuotesStatusSelector.test.tsx (6 tests) 131ms
543
540
  ✓  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/server/rootSpan.test.ts (4 tests) 39ms
542
+ ✓  node  test/pages/api/preview.test.ts (2 tests) 9ms
543
+ ✓  node  test/components/search/SearchInput.test.ts (6 tests) 7ms
544
+ ✓  node  test/components/account/Layout.test.tsx (6 tests) 63ms
546
545
  ✓  node  test/utils/validateSessionRefreshToken.test.ts (6 tests) 5ms
547
- ✓  node  test/server/rootSpan.test.ts (4 tests) 38ms
548
- ✓  node  test/sdk/recommendations/vrn.test.ts (5 tests) 4ms
546
+ ✓  node  test/sdk/recommendations/vrn.test.ts (5 tests) 5ms
547
+ ✓  node  test/utils/retry.test.ts (5 tests) 13ms
549
548
  ✓  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
549
  ✓  node  test/sdk/account/getB2BSessionClaims.test.ts (4 tests) 5ms
554
- ✓  node  test/utils/unlockResponse.test.ts (11 tests) 6ms
550
+ ✓  node  test/utils/unlockResponse.test.ts (11 tests) 8ms
555
551
  ✓  node  test/server/cms/myAccountDefaultSections.test.ts (5 tests) 4ms
552
+ ✓  node  test/sdk/recommendations/useRecommendationUserId.test.ts (4 tests) 188ms
556
553
  ✓  node  test/sdk/recommendations/useRecommendations.test.ts (2 tests) 4ms
557
- ✓  node  test/utils/isLocalHost.test.ts (7 tests) 5ms
558
- ✓  node  test/components/account/OrganizationDrawerBody.test.tsx (3 tests) 45ms
554
+ ✓  node  test/components/account/OrganizationDrawerBody.test.tsx (3 tests) 38ms
555
+ ✓  node  test/utils/isLocalHost.test.ts (7 tests) 4ms
559
556
  ✓  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
557
+ ✓  node  test/utils/getCookie.test.ts (4 tests) 4ms
558
+ ✓  node  test/sdk/analytics/utils.test.ts (2 tests) 4ms
563
559
  ✓  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
560
+ ✓  node  test/components/auth/ProfileChallenge.test.tsx (3 tests) 28ms
561
+ ✓  node  test/components/quotes/MyAccountQuoteStatusBadge.test.tsx (2 tests) 31ms
562
+ ✓  node  test/sdk/account/clearPersistedSessionState.test.ts (1 test) 10ms
566
563
 
567
564
   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)
565
+  Tests  698 passed (698)
566
+  Start at  20:10:15
567
+  Duration  41.13s (transform 9.78s, setup 0ms, import 36.14s, tests 13.03s, environment 52.30s)
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.1",
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.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.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 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', () => {