Skip to content

refactor: remove dead slot-count prop from TabsNav - #1132

Open
tarekooooooo wants to merge 4 commits into
richshaw:mainfrom
tarekooooooo:refactor/remove-tabs-nav-slot-count
Open

tarekooooooo wants to merge 4 commits into
richshaw:mainfrom
tarekooooooo:refactor/remove-tabs-nav-slot-count

Conversation

@tarekooooooo

Copy link
Copy Markdown
Contributor

Closes #1128

Signed-off-by: tarekooooooo <tarekai042@gmail.com>
Signed-off-by: tarekooooooo <tarekai042@gmail.com>
Signed-off-by: tarekooooooo <tarekai042@gmail.com>
Signed-off-by: tarekooooooo <tarekai042@gmail.com>
@richshaw

Copy link
Copy Markdown
Owner

Thanks for this! The change to the app is right, but two things in TabsNav.test.tsx are failing CI:

  1. All 6 TabsNav tests fail. The tests now render inside a BuildBridge, which calls useRouter(), but this file's mock of next/navigation only provides usePathname. Add useRouter to the mock, as BuildBridge.test.tsx does:

    vi.mock('next/navigation', () => ({
      useRouter: () => ({ push: vi.fn() }),
      usePathname: () => nav.pathname,
    }));
  2. Formatting check fails. Lines 73–75 should be one line: const { rerender } = render(navElement());. Running pnpm format fixes it.

With both changes, all 28 TabsNav and BuildBridge tests pass locally. Typecheck, lint and knip already pass, so that should be everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TabsNav takes a slot count it only uses outside a BuildBridge, which only its tests do

2 participants