Skip to content

Many login attempts (Vitest)

Example: Many login attempts: [email protected] -> success

### ✅ Many login attempts: [email protected] -> success
- **Given** the user is on the login page
- **When** the user logs in with "[email protected]" and "secret"
- **Then** the login result should be "success"
const manyLoginExamples = [
{ email: "[email protected]", password: "secret", result: "success" },
{ email: "[email protected]", password: "wrong", result: "fail" },
// ...
];
for (const row of manyLoginExamples) {
it(`Many login attempts: ${row.email} -> ${row.result}`, ({ 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 login result should be "${row.result}"`);
});
}