From aa5b277b6badf2fd689157d54935970f91ba333e Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 4 May 2026 07:05:20 -0400 Subject: [PATCH] fix(web/m7-365): history page error-state test asserts by role --- web/src/routes/library/history/page.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/src/routes/library/history/page.test.ts b/web/src/routes/library/history/page.test.ts index 5210ea6a..b276e064 100644 --- a/web/src/routes/library/history/page.test.ts +++ b/web/src/routes/library/history/page.test.ts @@ -99,9 +99,10 @@ describe('library/history page', () => { it('renders error banner on isError', () => { mockIsError = true; render(HistoryPage); - // ApiErrorBanner renders generic error copy. The default message - // it falls back to is "Something went wrong." - expect(screen.getByText(/something went wrong/i)).toBeInTheDocument(); + // ApiErrorBanner renders a role="alert" container. Assert by role + // rather than by message text, since the message comes from the + // error object's `.message` property and varies. + expect(screen.getByRole('alert')).toBeInTheDocument(); }); it('does not render the InfiniteScrollSentinel when hasNextPage is false', () => {