Merge branch 'main' into feature/203-demo-notice-wording
Linting / lint (pull_request) Successful in 1m55s
SonarQube Analysis / sonarqube (pull_request) Failing after 16m55s

This commit is contained in:
2026-08-28 14:05:07 -05:00
11 changed files with 241 additions and 27 deletions
+26
View File
@@ -66,6 +66,32 @@ test.describe('Demo mode says so to the customer', () => {
await expect(cart.checkoutButton).toHaveCount(0);
});
// The toast is three seconds; this is the record the customer comes back to
// when they wonder where their item is. It showed `demo` as a raw value under
// a "Processor" heading, beside a real price and a neutral `completed` tag —
// nothing a customer would read as "this did not happen". See #205.
test('order history marks the demo order rather than showing it as a real one', async ({
page,
customer,
cart,
orders
}) => {
const name = `Demo h${uniqueSuffix()}`;
const item = await createItem(page.request, { name, price: '80' });
expect((await page.request.post(`/api/cart/items/${item.id}`)).status()).toBe(201);
expect((await page.request.post('/api/customers/me/addresses', { data: ADDRESS })).ok()).toBe(true);
await cart.goto();
await expect(cart.checkoutButton).toBeVisible({ timeout: 20000 });
await cart.checkoutButton.click();
await expect(page.getByText(/nothing was charged/i)).toBeVisible({ timeout: 20000 });
await orders.goto();
await expect(orders.demoOrderMarker).toBeVisible({ timeout: 20000 });
await expect(orders.demoNotice).toBeVisible();
});
test('the confirmation says nothing was charged', async ({ page, customer, cart }) => {
const name = `Demo p${uniqueSuffix()}`;
const item = await createItem(page.request, { name, price: '80' });
+4
View File
@@ -14,6 +14,8 @@ export class OrdersPage {
readonly continueShoppingButton: Locator;
readonly backToShopButton: Locator;
readonly anyDialog: Locator;
readonly demoNotice: Locator;
readonly demoOrderMarker: Locator;
constructor(private readonly page: Page) {
this.heading = page.getByRole('heading', { name: 'Order History' });
@@ -21,6 +23,8 @@ export class OrdersPage {
this.continueShoppingButton = page.getByRole('button', { name: 'Continue Shopping' });
this.backToShopButton = page.getByRole('button', { name: 'Back to Shop' });
this.anyDialog = page.getByRole('dialog');
this.demoNotice = page.getByText('Some of these are demo orders');
this.demoOrderMarker = page.getByText('Demo (not charged)');
}
async goto(): Promise<void> {