Skip to content

CORS Preflight Block

Simulate a browser-style CORS/network failure and assert that the UI explains the blocked integration.

await injectChaos(page, {
seed: 42,
network: { cors: [{ urlPattern: '/api/external-tax', methods: ['OPTIONS', 'POST'], probability: 1 }] },
});
await page.goto('/checkout');
await page.click('#estimate-tax');
await expect(page.locator('[data-testid="tax-service-error"]')).toBeVisible();
expect((await getChaosLog(page)).some((event) => event.type === 'network:cors' && event.applied)).toBe(true);