From ee13d47aebbf592b13de717d5afe3ff94768bf51 Mon Sep 17 00:00:00 2001 From: Avi Date: Tue, 1 Sep 2026 11:27:23 -0500 Subject: [PATCH] fix(polish): align Compose button label with sidebar nav MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - HomeScreen header button: 'Compose note' → 'Compose' (matches sidebar) - Updated tests to use exact name match and scoped queries to avoid matching the sidebar nav button --- frontend/src/screens/HomeScreen.tsx | 2 +- frontend/src/test/HomeScreen.test.tsx | 2 +- frontend/src/test/publishFlow.test.tsx | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/screens/HomeScreen.tsx b/frontend/src/screens/HomeScreen.tsx index 5908e36..61f5521 100644 --- a/frontend/src/screens/HomeScreen.tsx +++ b/frontend/src/screens/HomeScreen.tsx @@ -72,7 +72,7 @@ export function HomeScreen({ onNavigate, onCreateProfile }: HomeScreenProps) { diff --git a/frontend/src/test/HomeScreen.test.tsx b/frontend/src/test/HomeScreen.test.tsx index f1e2c6f..154ae9e 100644 --- a/frontend/src/test/HomeScreen.test.tsx +++ b/frontend/src/test/HomeScreen.test.tsx @@ -30,7 +30,7 @@ describe('HomeScreen', () => { expect(within(identityCard).getByText('Alice')).toBeInTheDocument(); expect(within(identityCard).getByText(/npub1alice\.\.\./)).toBeInTheDocument(); - const compose = screen.getByRole('button', { name: /Compose note/i }); + const compose = screen.getByRole('button', { name: 'Compose' }); await userEvent.setup().click(compose); expect(onNavigate).toHaveBeenCalledWith('compose'); }); diff --git a/frontend/src/test/publishFlow.test.tsx b/frontend/src/test/publishFlow.test.tsx index 53ea87c..d2c6299 100644 --- a/frontend/src/test/publishFlow.test.tsx +++ b/frontend/src/test/publishFlow.test.tsx @@ -1,4 +1,4 @@ -import { render, screen } from '@testing-library/react'; +import { render, screen, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import App from '../App'; import { createFakeBackend, installFakeBackend } from './fakeBackend'; @@ -13,7 +13,8 @@ describe('publication flow across screens', () => { await screen.findByRole('heading', { name: 'Home' }); - await user.click(screen.getByRole('button', { name: /Compose note/i })); + const main = screen.getByRole('main'); + await user.click(within(main).getByRole('button', { name: 'Compose' })); await screen.findByRole('heading', { name: 'Compose' }); await user.type(screen.getByLabelText('Note content'), 'Hello from the flow test');