From 755794cd0cd3513877e12d1d239f987420ff8d0b Mon Sep 17 00:00:00 2001 From: Conduction Release Bot Date: Mon, 7 Sep 2026 20:04:15 +0200 Subject: [PATCH] fix(e2e): the same ambiguous locator, one file over #642 fixed this strict-mode violation in `tests/e2e/workflows/vault-unlock.spec.ts` and left the identical locator in `tests/e2e/spec-coverage/lock-screen.spec.ts` untouched, so keepiq's development E2E stayed red on the same defect: strict mode violation: locator('.lock-screen') .getByText(/Wrong master password|decryption failed/i) resolved to 2 elements: 1)

I reported keepiq as fixed after #642 merged. It was not: I had fixed the spec that failed rather than the LOCATOR that was wrong, and the second copy failed the very next run on a tree containing the fix. Same treatment as #642, so the two files now agree. Each surface is asserted on its own: the helper text is what a sighted reader sees, the visually-hidden role="alert" is what a screen reader announces, and it was added deliberately so a rejected credential interrupts rather than going unspoken. Narrowing to either one alone would let the other be removed with no test noticing, which for the live region means losing the announcement silently. The two remaining uses in `tests/e2e/workflows/_workflow-helpers.ts` are `.count()` and `.first().textContent()`. Neither is strict-mode sensitive, so they are correct as they stand and are left alone. prettier clean. Co-Authored-By: Claude Opus 5 (1M context) --- tests/e2e/spec-coverage/lock-screen.spec.ts | 27 +++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/tests/e2e/spec-coverage/lock-screen.spec.ts b/tests/e2e/spec-coverage/lock-screen.spec.ts index b944c6cee..b4fdc0385 100644 --- a/tests/e2e/spec-coverage/lock-screen.spec.ts +++ b/tests/e2e/spec-coverage/lock-screen.spec.ts @@ -132,12 +132,29 @@ test.describe('Lock screen — spec: encryption-suites/spec.md', () => { .first() .click({ force: true }) - // Error note card appears and we remain on the lock screen. + // THE MESSAGE IS ON TWO SURFACES ON PURPOSE, and each is asserted on + // its own. The helper text under the field is what a sighted reader + // sees; the visually-hidden role="alert" is what a screen reader + // announces, and it was added deliberately so a rejected credential + // interrupts rather than going unspoken. + // + // A single `.lock-screen`-wide text match resolved to BOTH and failed + // under strict mode on a correct page. Narrowing it to either one + // alone would let the other be removed without a test noticing, which + // for the live region means losing the announcement silently. + // + // The identical locator in `../workflows/vault-unlock.spec.ts` was + // fixed in #642 and this copy was missed, so development stayed red on + // the same defect one file over. Two files, one pattern: grep for the + // locator, not for the spec that happened to fail. + const wrongPassword = /Wrong master password|decryption failed/i + await expect(page.locator(`${LockScreen} [role="alert"]`)).toHaveText( + wrongPassword, + { timeout: 15_000 }, + ) await expect( - page - .locator(LockScreen) - .getByText(/Wrong master password|decryption failed/i), - ).toBeVisible({ timeout: 15_000 }) + page.locator(`${LockScreen} .input-field__helper-text-message`), + ).toHaveText(wrongPassword, { timeout: 15_000 }) await expect(lockHeading(page)).toHaveText(/Unlock Keepiq/i) await expect(page).toHaveURL(/\/lock/) })