feat(FN-786): move Settings to last position in overflow menu

- Reorder Header overflow menu items so Settings always appears last
- Update Header.tsx to position SettingsMenuItem as the final menu entry
- Add regression tests in Header.test.tsx verifying Settings is last in all overflow states
- Add ordering tests in tablet-header-controls.test.tsx for tablet layout
This commit is contained in:
gsxdsm
2026-04-03 08:49:01 -07:00
parent d67437a5a2
commit 549f1aa362
3 changed files with 123 additions and 8 deletions

View File

@@ -370,4 +370,40 @@ describe("tablet header controls", () => {
expect(screen.getByTestId("project-selector-trigger")).toBeDefined();
});
});
// ── Settings is the last overflow menu item ────────────────────
describe("overflow menu ordering on tablet", () => {
it("Settings is the last item in the tablet overflow menu when all optional items are present", () => {
const { container } = renderTabletHeader({
onOpenUsage: noop,
onOpenActivityLog: noop,
onOpenWorkflowSteps: noop,
onOpenMissions: noop,
onOpenFiles: noop,
onOpenGitManager: noop,
});
fireEvent.click(screen.getByTitle("More header actions"));
// Get all menu items inside the overflow menu
const menu = container.querySelector(".mobile-overflow-menu")!;
const menuItems = Array.from(menu.querySelectorAll<HTMLButtonElement>("button.mobile-overflow-item"));
// The last menu item should be Settings
const lastItem = menuItems[menuItems.length - 1];
expect(lastItem.textContent).toBe("Settings");
});
it("Settings is the last item in the tablet overflow menu when optional items are absent", () => {
renderTabletHeader();
fireEvent.click(screen.getByTitle("More header actions"));
const menu = screen.getByRole("menu");
const menuItems = Array.from(menu.querySelectorAll<HTMLButtonElement>("button[role='menuitem']"));
const lastItem = menuItems[menuItems.length - 1];
expect(lastItem.textContent).toBe("Settings");
});
});
});