@faststore/core 4.7.0-dev.0 → 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.6.1-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.6.1-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.6.1-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.6.1-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,18 @@
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) 1003ms
14
- ✓  browser  test/components/account/ContractSwitcher.browser.test.tsx (13 tests) 2752ms
15
- ✓ shows an error state when the list fails to load  800ms
16
- ✓ requires selecting a contract before Confirm is enabled, then switches (REQ-03)  326ms
17
- ✓ keeps Confirm disabled when switching is unavailable  306ms
18
- ✓  browser  test/components/account/cards/MyAccountListCards.browser.test.tsx (14 tests) 2097ms
19
- ✓ shows the tab bar and renders Personal cards by default  983ms
20
- ✓ paginates when there are more than 25 cards  355ms
21
- ✓  browser  test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx (8 tests) 288ms
22
- ✓  browser  test/sdk/session/reconcileSessionLocale.browser.test.ts (5 tests) 19ms
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
21
+ ✓  browser  test/sdk/session/reconcileSessionLocale.browser.test.ts (5 tests) 27ms
23
22
  stderr | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx
24
23
  Error in optimistic validation: TypeError: Failed to parse URL from /api/graphql?operationName=ValidateCartMutation&operationHash=3c71b0d3fc2bade14df68abfa271858beb361b12
25
24
   at node:internal/deps/undici/undici:16416:13
@@ -49,8 +48,9 @@ Browserslist: browsers data (caniuse-lite) is 6 months old. Please run:
49
48
  stderr | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx > RecommendationShelf > renders nothing when there is an error
50
49
  Error fetching recommendations undefined boom for campaign vrn:recommendations:acc:rec-top-items-v2:campaign-1
51
50
 
52
- ✓  browser  test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx (8 tests) 228ms
53
- ✓  browser  test/sdk/recommendations/useRecommendationShelf.browser.test.tsx (10 tests) 170ms
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
54
54
  stderr | test/pages/password-protection.browser.test.tsx > PasswordProtectionLogin > posts the password and redirects to the requested return path
55
55
  Warning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
56
56
 
@@ -136,7 +136,6 @@ act(() => {
136
136
  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
137
137
  at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
138
138
 
139
- ✓  browser  test/sdk/session/getInitialSession.browser.test.ts (6 tests) 10ms
140
139
  stderr | test/pages/password-protection.browser.test.tsx > PasswordProtectionLogin > uses the fallback invalid-password message when API omits an error
141
140
  Warning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
142
141
 
@@ -281,11 +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) 1289ms
285
- ✓ renders the password protection form  498ms
286
- ✓  browser  test/components/account/OrganizationDrawer.browser.test.tsx (5 tests) 1063ms
287
- ✓ renders the menu view with contract details and manage footer  678ms
288
- ✓  browser  test/sdk/account/changeContractToken.browser.test.ts (9 tests) 26ms
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
289
288
  stderr | test/sdk/localization/store-url.browser.test.ts
290
289
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
291
290
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -294,10 +293,10 @@ This ensures that you're testing the behavior the user would see in the browser.
294
293
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
295
294
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
296
295
 
297
- ✓  browser  test/sdk/localization/store-url.browser.test.ts (3 tests) 5ms
298
- ✓  browser  test/sdk/account/useAvailableContracts.browser.test.ts (6 tests) 27ms
299
- ✓  browser  test/components/templates/SearchPage/SearchWrapper.browser.test.tsx (3 tests) 27ms
300
- ✓  browser  test/sdk/account/useSwitchContract.browser.test.ts (4 tests) 40ms
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
301
300
  stderr | test/components/account/doLogout.browser.test.ts
302
301
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
303
302
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -306,10 +305,9 @@ This ensures that you're testing the behavior the user would see in the browser.
306
305
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
307
306
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
308
307
 
309
- ✓  browser  test/components/account/doLogout.browser.test.ts (1 test) 27ms
310
- ✓  browser  test/components/sections/Account/AccountListCards.browser.test.tsx (3 tests) 85ms
311
- ✓  browser  test/components/account/OrganizationDrawerHeader.browser.test.tsx (3 tests) 289ms
312
- ✓  browser  test/components/account/OrganizationDrawerFooter.browser.test.tsx (3 tests) 268ms
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
313
311
  stderr | test/sdk/account/clearPersistedSessionState.browser.test.ts
314
312
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
315
313
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -318,10 +316,10 @@ This ensures that you're testing the behavior the user would see in the browser.
318
316
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
319
317
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
320
318
 
321
- ✓  browser  test/sdk/account/clearPersistedSessionState.browser.test.ts (1 test) 7ms
322
- ✓  browser  test/utils/isLocalHost.browser.test.ts (3 tests) 6ms
319
+ ✓  browser  test/components/account/OrganizationDrawerFooter.browser.test.tsx (3 tests) 240ms
320
+ ✓  browser  test/utils/isLocalHost.browser.test.ts (3 tests) 5ms
321
+ ✓  browser  test/sdk/account/clearPersistedSessionState.browser.test.ts (1 test) 8ms
323
322
  ✓  browser  test/sdk/session/reconcileSessionLocale.disabled.browser.test.ts (1 test) 3ms
324
- ✓  node  test/utils/localization/bindingPaths.test.ts (71 tests) 26ms
325
323
  stderr | test/sdk/account/refreshToken.browser.test.ts
326
324
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
327
325
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -330,13 +328,14 @@ This ensures that you're testing the behavior the user would see in the browser.
330
328
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
331
329
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
332
330
 
333
- ✓  browser  test/components/skeletons/ProductGridSkeleton.browser.test.tsx (2 tests) 43ms
334
- ✓  browser  test/sdk/account/refreshToken.browser.test.ts (1 test) 5ms
335
- ✓  node  test/server/password-protection-service.test.ts (22 tests) 42ms
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
336
334
  ✓  node  test/utils/match-url.test.ts (10 tests) 11ms
337
- ✓  node  test/pages/api/unlock.test.ts (15 tests) 232ms
338
- ✓  node  test/sdk/localization/useBindingSelector.test.tsx (22 tests) 11ms
339
- ✓  node  test/sdk/localization/bindingSelector.test.ts (18 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
340
339
  stderr | test/components/search/SearchInputComponent.test.tsx
341
340
  Warning: forwardRef render functions accept exactly two parameters: props and ref. Did you forget to use the ref parameter?
342
341
 
@@ -400,19 +399,19 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
400
399
  at Suspense
401
400
  at Wrapper (/home/runner/work/faststore/faststore/packages/core/test/components/search/SearchInputComponent.test.tsx:106:20)
402
401
 
403
- ✓  node  test/components/search/SearchInputComponent.test.tsx (6 tests) 76ms
404
- ✓  node  test/sdk/search/useSearchHistory.test.ts (13 tests) 53ms
405
- ✓  node  test/utils/cookieCacheBusting.test.ts (10 tests) 18ms
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
406
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
407
406
  { extensions: { status: 401 } }
408
407
 
409
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
410
409
  { extensions: { status: 502 } }
411
410
 
412
- ✓  node  test/pages/pvt/account/cards/index.test.ts (8 tests) 12ms
413
- ✓  node  test/experimental/myAccountCmsServerSideProps.test.ts (5 tests) 7ms
414
- ✓  node  test/utils/clearCookies.test.ts (20 tests) 28ms
415
- ✓  node  test/components/quotes/MyAccountListQuotesTable.test.tsx (12 tests) 407ms
411
+ ✓  node  test/pages/pvt/account/cards/index.test.ts (8 tests) 11ms
412
+ ✓  node  test/utils/clearCookies.test.ts (20 tests) 25ms
413
+ ✓  node  test/experimental/myAccountCmsServerSideProps.test.ts (5 tests) 9ms
414
+ ✓  node  test/components/quotes/MyAccountListQuotesTable.test.tsx (12 tests) 380ms
416
415
  stderr | test/pages/api/graphql.test.ts > /api/graphql error status propagation > propagates the upstream 400 from a wrapped BadRequestError instead of 500
417
416
  Graphql execution returned with error: [
418
417
  {
@@ -505,65 +504,65 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
505
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
506
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)
507
506
 
508
- ✓  node  test/pages/api/graphql.test.ts (17 tests) 33ms
509
- ✓  node  test/components/quotes/MyAccountListQuotes.test.tsx (9 tests) 831ms
510
- ✓ navigates with the search term on blur  362ms
511
- ✓ navigates without a label param when the search is cleared  357ms
507
+ ✓  node  test/pages/api/graphql.test.ts (17 tests) 36ms
512
508
  stderr | test/sdk/account/useSetPassword.test.ts > useSetPassword > maps wrongcredentials error responses to the existing message
513
509
  Set password request failed: Bad Request
514
510
 
515
- ✓  node  test/sdk/account/useSetPassword.test.ts (6 tests) 51ms
516
- ✓  node  test/sdk/orderEntry/useOrderEntryOperation.test.ts (8 tests) 42ms
517
- ✓  node  test/components/quotes/quoteFilters.test.ts (23 tests) 49ms
518
- ✓  node  test/utils/multipleTemplates.test.ts (8 tests) 6ms
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
515
+ ✓  node  test/sdk/orderEntry/useOrderEntryOperation.test.ts (8 tests) 39ms
516
+ ✓  node  test/components/quotes/quoteFilters.test.ts (23 tests) 34ms
517
+ ✓  node  test/utils/multipleTemplates.test.ts (8 tests) 7ms
519
518
  ✓  node  test/utils/localization/localizeRedirectDestination.test.ts (11 tests) 7ms
520
- ✓  node  test/sdk/orderEntry/useOrderEntryUpload.test.ts (8 tests) 64ms
521
- ✓  node  test/sdk/account/getMyAccountRoutes.test.ts (11 tests) 10ms
522
- ✓  node  test/components/quotes/MyAccountQuotesFilterSlider.test.tsx (5 tests) 165ms
523
- ✓  node  test/sdk/analytics/useStartRecommendationSession.test.ts (6 tests) 58ms
524
- ✓  node  test/server/index.test.ts (7 tests) 866ms
525
- ✓ should return a valid merged GraphQL schema  314ms
526
- ✓  node  test/sdk/orderEntry/useOrderEntry.test.ts (8 tests) 40ms
527
- ✓  node  test/proxy.localization.test.ts (5 tests) 50ms
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
528
527
  ✓  node  test/sdk/session/syncSalesChannelFromOrderForm.test.ts (6 tests) 8ms
529
- ✓  node  test/proxy.test.ts (4 tests) 18ms
530
- ✓  node  test/server/webops-api.test.ts (9 tests) 14ms
531
- ✓  node  test/components/quotes/MyAccountQuotesSelectedTags.test.tsx (8 tests) 112ms
532
- ✓  node  test/server/content/service.test.ts (5 tests) 7ms
533
- ✓  node  test/sdk/orderEntry/useOrderFormItems.test.ts (7 tests) 63ms
534
- ✓  node  test/sdk/cart/waitForSessionValidated.test.ts (5 tests) 11ms
535
- ✓  node  test/sdk/account/refreshToken.test.ts (5 tests) 9ms
536
- ✓  node  test/server/cms/global.test.ts (3 tests) 6ms
537
- ✓  node  test/sdk/localization/store-url.test.ts (1 test) 5ms
538
- ✓  node  test/sdk/auth/useAuth.test.ts (5 tests) 36ms
539
- ✓  node  test/components/quotes/MyAccountQuotesStatusSelector.test.tsx (6 tests) 146ms
528
+ ✓  node  test/proxy.test.ts (4 tests) 15ms
529
+ ✓  node  test/server/webops-api.test.ts (9 tests) 15ms
530
+ ✓  node  test/server/content/service.test.ts (5 tests) 5ms
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
536
+ ✓  node  test/sdk/localization/store-url.test.ts (1 test) 4ms
537
+ ✓  node  test/sdk/auth/useAuth.test.ts (5 tests) 29ms
538
+ ✓  node  test/components/quotes/MyAccountQuotesStatusSelector.test.tsx (6 tests) 119ms
540
539
  ✓  node  test/sdk/analytics/hasEnabledRecommendationShelf.test.ts (6 tests) 5ms
541
540
  ✓  node  test/utils/getRequestHostname.test.ts (12 tests) 6ms
541
+ ✓  node  test/server/rootSpan.test.ts (4 tests) 39ms
542
542
  ✓  node  test/pages/api/preview.test.ts (2 tests) 9ms
543
- ✓  node  test/components/search/SearchInput.test.ts (6 tests) 8ms
544
- ✓  node  test/server/rootSpan.test.ts (4 tests) 32ms
545
- ✓  node  test/utils/validateSessionRefreshToken.test.ts (6 tests) 6ms
543
+ ✓  node  test/components/search/SearchInput.test.ts (6 tests) 7ms
544
+ ✓  node  test/components/account/Layout.test.tsx (6 tests) 63ms
545
+ ✓  node  test/utils/validateSessionRefreshToken.test.ts (6 tests) 5ms
546
546
  ✓  node  test/sdk/recommendations/vrn.test.ts (5 tests) 5ms
547
- ✓  node  test/server/cms/index.test.ts (2 tests) 7ms
548
- ✓  node  test/utils/retry.test.ts (5 tests) 20ms
549
- ✓  node  test/components/account/Layout.test.tsx (4 tests) 39ms
550
- ✓  node  test/sdk/recommendations/useRecommendationUserId.test.ts (4 tests) 201ms
551
- ✓  node  test/sdk/account/getB2BSessionClaims.test.ts (4 tests) 6ms
552
- ✓  node  test/utils/unlockResponse.test.ts (11 tests) 7ms
553
- ✓  node  test/server/cms/myAccountDefaultSections.test.ts (5 tests) 7ms
547
+ ✓  node  test/utils/retry.test.ts (5 tests) 13ms
548
+ ✓  node  test/server/cms/index.test.ts (2 tests) 5ms
549
+ ✓  node  test/sdk/account/getB2BSessionClaims.test.ts (4 tests) 5ms
550
+ ✓  node  test/utils/unlockResponse.test.ts (11 tests) 8ms
551
+ ✓  node  test/server/cms/myAccountDefaultSections.test.ts (5 tests) 4ms
552
+ ✓  node  test/sdk/recommendations/useRecommendationUserId.test.ts (4 tests) 188ms
554
553
  ✓  node  test/sdk/recommendations/useRecommendations.test.ts (2 tests) 4ms
555
- ✓  node  test/utils/isLocalHost.test.ts (7 tests) 6ms
556
- ✓  node  test/components/account/OrganizationDrawerBody.test.tsx (3 tests) 56ms
557
- ✓  node  test/utils/userOrderStatus.test.ts (3 tests) 5ms
558
- ✓  node  test/utils/getCookie.test.ts (4 tests) 5ms
554
+ ✓  node  test/components/account/OrganizationDrawerBody.test.tsx (3 tests) 38ms
555
+ ✓  node  test/utils/isLocalHost.test.ts (7 tests) 4ms
556
+ ✓  node  test/utils/userOrderStatus.test.ts (3 tests) 3ms
557
+ ✓  node  test/utils/getCookie.test.ts (4 tests) 4ms
559
558
  ✓  node  test/sdk/analytics/utils.test.ts (2 tests) 4ms
560
- ✓  node  test/components/auth/ProfileChallenge.test.tsx (3 tests) 45ms
561
- ✓  node  test/instrumentation.test.ts (3 tests) 7ms
562
- ✓  node  test/sdk/account/clearPersistedSessionState.test.ts (1 test) 18ms
563
- ✓  node  test/components/quotes/MyAccountQuoteStatusBadge.test.tsx (2 tests) 24ms
559
+ ✓  node  test/instrumentation.test.ts (3 tests) 6ms
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
564
563
 
565
564
   Test Files  87 passed (87)
566
-  Tests  695 passed (695)
567
-  Start at  12:28:43
568
-  Duration  43.06s (transform 10.71s, setup 0ms, import 37.10s, tests 13.95s, environment 54.21s)
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)
569
568
 
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.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
+
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)
13
+
14
+ **Note:** Version bump only for package @faststore/core
15
+
6
16
  # [4.7.0-dev.0](https://github.com/vtex/faststore/compare/v4.6.1-dev.0...v4.7.0-dev.0) (2026-08-24)
7
17
 
8
18
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "4.7.0-dev.0",
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.0",
75
- "@faststore/sdk": "4.7.0-dev.0",
76
- "@faststore/diagnostics": "4.7.0-dev.0",
77
- "@faststore/lighthouse": "4.7.0-dev.0",
78
- "@faststore/ui": "4.7.0-dev.0"
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', () => {