Forms & validation · level 2 of 5 · Nimbus
A test can fail because it asserts the wrong outcome. Read what the app actually does, then assert that.
This test enters a wrong password and expects to reach the dashboard, but a wrong password should be rejected, so the test fails.
Fix the assertion to check for the error message (data-testid="login-error") instead.
Fix the failing test
This test is red right now. Run it to see how it fails, then edit until it passes, without weakening what it checks.
We break each one in a copy of the app. Your fixed test has to fail on every copy.