Skip to content

Payment declined

Then states what happened. But states what did not.

import { story } from 'executable-stories-vitest';
import { it } from 'vitest';
it("Payment declined", ({ task }) => {
story.init(task);
story.given("the user is on the checkout page");
story.when("the user submits a declined card");
story.then("the payment should be declined");
story.then('the user should see "Payment failed"');
story.but("the order should not be created");
});
### ✅ Payment declined
- **Given** the user is on the checkout page
- **When** the user submits a declined card
- **Then** the payment should be declined
- **And** the user should see "Payment failed"
- **But** the order should not be created