test(acceptance): qualify preference concurrency and Board membership

This commit is contained in:
cesnimda
2026-10-10 22:39:25 +02:00
parent eba7ad19c6
commit 227e3b4a22
3 changed files with 488 additions and 7 deletions
@@ -63,8 +63,8 @@ test('[P5-15-01 diagnostic] native language and notification saves persist durin
await page.goto('/settings');
await notification.goto('/settings');
await notification.getByRole('tab', { name: 'Notifications', exact: true }).click();
// Three alternating rounds reproduce concurrency; this is bounded diagnosis, not a load test.
for (const language of ['nb', 'en', 'nb'] as const) {
// Twelve alternating rounds qualify the recorded overlap; this is not production load evidence.
for (const language of Array.from({ length: 12 }, (_, index) => index % 2 ? 'en' : 'nb')) {
const current = language === 'nb' ? translations.en : translations.nb;
const target = translations[language];
const enabled = language === 'en';
@@ -100,11 +100,40 @@ test('[P5-15-01 diagnostic] native language and notification saves persist durin
await expect(page.getByRole('combobox', { name: target.settingsPreferredLanguage, exact: true })).toBeVisible();
}
await page.reload(); await notification.reload();
await expect(page.locator('html')).toHaveAttribute('lang', 'nb-NO');
await notification.getByRole('tab', { name: translations.nb.settingsTabNotifications, exact: true }).click();
await expect(notification.getByLabel(translations.nb.settingsNotificationsFollowUpReminders, { exact: true })).not.toBeChecked();
await expect(page.locator('html')).toHaveAttribute('lang', 'en');
await notification.getByRole('tab', { name: translations.en.settingsTabNotifications, exact: true }).click();
await expect(notification.getByLabel(translations.en.settingsNotificationsFollowUpReminders, { exact: true })).toBeChecked();
} finally {
await info.attach('native-preference-concurrency', { body: JSON.stringify(evidence, null, 2), contentType: 'application/json' });
await notification.close();
}
});
test('[P5-15-04 PRES-J07 J05] native full-result Board retains membership at 200 and 1000 owned jobs', async ({ page, headers }, info) => {
test.setTimeout(360_000);
const company = await page.request.post(`${apiUrl}/companies`, { headers, data: { name: 'Synthetic scaling company' } });
expect(company.status()).toBe(201);
const companyId = (await company.json()).id;
const observations = [];
let createdCount = 0;
for (const count of [200, 1000]) {
while (createdCount < count) {
const response = await page.request.post(`${apiUrl}/jobapplications`, { headers, data: { companyId, jobTitle: `Scaling fixture ${++createdCount}`, status: 'Saved' } });
expect(response.status()).toBe(201);
}
const apiStarted = Date.now();
const board = await page.request.get(`${apiUrl}/jobapplications/board`, { headers });
expect(board.status()).toBe(200);
const body = await board.json();
expect(body).toHaveLength(count);
const apiMs = Date.now() - apiStarted;
const started = Date.now();
await page.goto('/jobs?view=board');
await expect(page.locator('[data-kanban-card-id]')).toHaveCount(count, { timeout: 60_000 });
const renderedIds = await page.locator('[data-kanban-card-id]').evaluateAll(nodes => nodes.map(node => Number(node.getAttribute('data-kanban-card-id'))).sort((a, b) => a - b));
expect(renderedIds).toEqual(body.map((job: { id: number }) => job.id).sort((a: number, b: number) => a - b));
observations.push({ count, apiMs, renderMs: Date.now() - started, responseBytes: (await board.body()).length, renderedCards: renderedIds.length });
await info.attach(`board-${count}-native-membership`, { body: JSON.stringify(observations.at(-1)), contentType: 'application/json' });
}
await info.attach('board-full-result-scaling', { body: JSON.stringify({ observations, threshold: 'No approved production performance threshold; timings are observations, not a scalability acceptance claim', physicalTouch: 'NOT VERIFIED' }), contentType: 'application/json' });
});