Skip to content

Checkout calculates totals

One Given, one When, three Then steps. Repeated Then renders as And.

import { story } from 'executable-stories-vitest';
import { it } from 'vitest';
it("Checkout calculates totals", ({ task }) => {
story.init(task);
story.given("the cart has 2 items");
story.when("the user proceeds to checkout");
story.then("the subtotal should be $40.00");
story.then("the tax should be $4.00");
story.then("the total should be $44.00");
});
### ✅ Checkout calculates totals
- **Given** the cart has 2 items
- **When** the user proceeds to checkout
- **Then** the subtotal should be $40.00
- **And** the tax should be $4.00
- **And** the total should be $44.00