fix(e2e): match the destructive error box by class substring #476
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-480-e2e-destructive-selector"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the
tests/auth/login.spec.tsfailure (hub login did not leave /login (current: /login/2fa) - no error message rendered) introduced by BUNYIP-464.Root cause
BUNYIP-464 renamed the destructive error TEXT class from
text-destructivetotext-destructive-text(the dark-mode-legible token) inviews/ui.rs::error_boxand the auth surfaces. The/login/2fa"Invalid verification code" error is rendered on the 2FA card viaerror_box(auth_pages.rs:664), so it now carriestext-destructive-text.e2e/lib/login.tsselected.text-destructiveat three sites. A CSS class selector.text-destructivedoes not match an element whose class istext-destructive-text, so the selector matched nothing. That blinded the 2FA single-use-collision recovery infillTotpStep: setup's login and the auth-ui login can land in the same 30s TOTP step, so the second submission carries an already-consumed code and bunyip re-renders "Invalid verification code"; the helper detects that, waits out the step, and resubmits a fresh code. With the selector blind,readLoginErrorreturned null,fillTotpStepassumed a navigation race and returned early, and the spec failed reporting "no error message rendered" even though the page visibly showed the error.Fix
Broaden the three selectors to the attribute-substring
[class*="text-destructive"], which matches both the legacytext-destructiveand the currenttext-destructive-text(and any futuretext-destructive-*). On/loginand/login/2fathe onlytext-destructive*elements are the error surfaces, so the match stays false-positive-free. The two coupling comments now nametext-destructive-textand explain the substring match, so the next token rename does not re-break the suite.Verification
tsc --noEmitclean. The fix restores the recovery path the spec relies on; the E2E suite confirms end to end.#BUNYIP-480