This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test('expired wallboard session is revoked once without periodic 401 churn', async ({ page }, testInfo) => {
|
||||
test.skip(testInfo.project.name !== 'wallboard-chromium', 'The long-running wallboard owns this session boundary.');
|
||||
let apiRequests = 0;
|
||||
await page.route('**/api/v1/**', async (route) => {
|
||||
apiRequests += 1;
|
||||
await route.fulfill({ status: 401, contentType: 'application/problem+json', body: JSON.stringify({ code: 'UNAUTHENTICATED' }) });
|
||||
});
|
||||
|
||||
await page.goto('/wallboard?interval=10&refresh=10');
|
||||
await expect(page.getByRole('heading', { level: 1, name: 'Geen toegang' })).toBeVisible();
|
||||
await expect(page.getByRole('link', { name: 'Aanmelden' })).toBeVisible();
|
||||
await expect.poll(() => apiRequests).toBeGreaterThan(0);
|
||||
const boundaryRequests = apiRequests;
|
||||
// Development StrictMode mounts the four bootstrap readers twice. The
|
||||
// production bundle issues one batch; neither mode may start a second one.
|
||||
expect(boundaryRequests).toBeLessThanOrEqual(8);
|
||||
|
||||
await page.waitForTimeout(12_000);
|
||||
expect(apiRequests).toBe(boundaryRequests);
|
||||
await expect(page.getByRole('heading', { level: 1, name: 'Geen toegang' })).toBeVisible();
|
||||
});
|
||||
Reference in New Issue
Block a user