Skip to content

Login errors (Vitest)

Example for one row:

### ✅ Login errors: Account is locked
- **Given** the user is on the login page
- **When** the user logs in with "[email protected]" and "secret"
- **Then** the error message should be "Account is locked"
const loginErrorExamples = [
{ email: "[email protected]", password: "wrong", message: "Invalid credentials" },
{ email: "[email protected]", password: "secret", message: "Account is locked" },
{ email: "[email protected]", password: "secret", message: "Invalid credentials" },
];
for (const row of loginErrorExamples) {
it(`Login errors: ${row.message}`, ({ task }) => {
story.init(task);
story.given("the user is on the login page");
story.when(`the user logs in with "${row.email}" and "${row.password}"`);
story.then(`the error message should be "${row.message}"`);
});
}