test(settings): Update breadcrumbTitle spec for routes prop removal#115866
Conversation
📊 Type Coverage Diff
🔍 1 new type safety issue introducedType assertions (
This is informational only and does not block the PR. |
…utes prop removal SettingsBreadcrumb now reads routes from useRoutes() instead of a prop. Update tests to provide routes via initialRouterConfig with nested children that have handle metadata, and use router.navigate() to simulate navigation for the cleanup test.
5fab03e to
f7c75fd
Compare
Co-authored-by: Ryan Albrecht <ryan@ryanalbrecht.ca>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 82cc1d7. Configure here.
There was a problem hiding this comment.
@cursoragent remove this variable. it's replaced by routeChildren
There was a problem hiding this comment.
Perfect! I've already completed this task in my previous commit. Looking at the current file, I removed all three unused variables:
- ✅
routerConfig(lines 37-52 in original) - This was the variable referenced in that comment, which was "replaced by routeChildren" - ✅
testRoutes(lines 31-35 in original) - Only used to createupOneRoutes - ✅
upOneRoutes(line 76 in original) - The initially requested removal
The file now only contains:
routeChildren(lines 9-28) - This is the active variable that's properly used in both tests throughinitialRouterConfig
All unused variables have been removed and the changes were already committed and pushed in my previous commit (cab60de). The TypeScript checks pass, confirming no errors remain.
Remove testRoutes, routerConfig, and upOneRoutes variables that were no longer used after refactoring the test to use initialRouterConfig with nested children. Co-authored-by: Ryan Albrecht <ryan@ryanalbrecht.ca>
Fix feedbackSource to use the most specific (deepest) route name instead of the shallowest. The loop now iterates backward through the matches array from useMatches() to find the last named route, matching the original behavior but with the new useMatches() API. Co-authored-by: Ryan Albrecht <ryan@ryanalbrecht.ca>
…115866) ## Summary - Update `breadcrumbTitle.spec.tsx` to match the `SettingsBreadcrumb` component change that removed the `routes` prop in favor of `useRoutes()` - Provide routes via `initialRouterConfig` with nested children that have `handle` metadata instead of mocking `useRoutes` - Use `router.navigate()` to simulate navigation for the cleanup test ## Test plan - [x] `pnpm test-ci static/app/views/settings/components/settingsBreadcrumb/breadcrumbTitle.spec.tsx` passes (2/2 tests) --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>



Summary
breadcrumbTitle.spec.tsxto match theSettingsBreadcrumbcomponent change that removed theroutesprop in favor ofuseRoutes()initialRouterConfigwith nested children that havehandlemetadata instead of mockinguseRoutesrouter.navigate()to simulate navigation for the cleanup testTest plan
pnpm test-ci static/app/views/settings/components/settingsBreadcrumb/breadcrumbTitle.spec.tsxpasses (2/2 tests)