From a92d512459a83b6d4dd1aa5b82e0f9845e392ed3 Mon Sep 17 00:00:00 2001 From: Hadrien Kerlero <199662351+HadrienKerlero@users.noreply.github.com> Date: Mon, 23 Nov 2026 13:02:47 +0100 Subject: [PATCH] test(web): match the Reload history button by its exact name (#814) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - The reload-only bar's × is now labelled "Dismiss Reload history", which Playwright's default substring name match also selected; the five Reload history locators in history-gap-repair.browser.test.ts pass exact: true. --- test/history-gap-repair.browser.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/history-gap-repair.browser.test.ts b/test/history-gap-repair.browser.test.ts index 5fbabdd3..c9a371b3 100644 --- a/test/history-gap-repair.browser.test.ts +++ b/test/history-gap-repair.browser.test.ts @@ -358,7 +358,7 @@ describe.each([true, false])('manual history gap repair (touch: %s)', (touch) => await burst(page); expect((await bufferState(page)).numbers).not.toContain('NUMBER-090'); expect((await bufferState(page)).pulls).toBe(0); - const button = page.locator('#historyTruncationBar').getByRole('button', { name: 'Reload history' }); + const button = page.locator('#historyTruncationBar').getByRole('button', { name: 'Reload history', exact: true }); await button.waitFor({ state: 'visible' }); if (touch) await button.tap(); else await button.click(); @@ -382,7 +382,7 @@ describe.each([true, false])('manual history gap repair (touch: %s)', (touch) => await page.evaluate(() => { (window as RepairWindow).repairTest.inject = true; }); - const button = page.locator('#historyTruncationBar').getByRole('button', { name: 'Reload history' }); + const button = page.locator('#historyTruncationBar').getByRole('button', { name: 'Reload history', exact: true }); if (touch) await button.tap(); else await button.click(); await waitForRepair(page); @@ -461,7 +461,7 @@ describe.each([true, false])('manual history gap repair (touch: %s)', (touch) => requestAnimationFrame(() => requestAnimationFrame(() => resolve())); return promise; }); - expect(await page.getByRole('button', { name: 'Reload history' }).isVisible()).toBe(false); + expect(await page.getByRole('button', { name: 'Reload history', exact: true }).isVisible()).toBe(false); expect((await bufferState(page)).pulls).toBe(0); } catch (error) { throw await failureDetails(page, error); @@ -520,7 +520,7 @@ it('hides Reload history while a marked incoming tab capture is pending', async ); }, incoming); const bar = page.locator('#historyTruncationBar'); - expect(await bar.getByRole('button', { name: 'Reload history' }).count()).toBe(0); + expect(await bar.getByRole('button', { name: 'Reload history', exact: true }).count()).toBe(0); expect(await bar.isHidden()).toBe(true); await page.evaluate(async () => { const test = (window as RepairWindow).tabLoadTest!; @@ -635,7 +635,7 @@ it('holds an OMP reading row through repeated repaint history and capped live fl }, { session: SESSION, readingRow } ); - const button = page.locator('#historyTruncationBar').getByRole('button', { name: 'Reload history' }); + const button = page.locator('#historyTruncationBar').getByRole('button', { name: 'Reload history', exact: true }); await button.tap(); await waitForRepair(page); const measure = () =>