test(dashboard): qualify responsive layout and preview semantics
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { expect, test, type APIRequestContext, type Page, type TestInfo } from '@playwright/test';
|
||||
import AxeBuilder from '@axe-core/playwright';
|
||||
import { translations } from '../src/i18n/translations';
|
||||
import { defaultDashboardLayout } from '../src/dashboardLayout';
|
||||
|
||||
const apiUrl = 'http://localhost:5302/api';
|
||||
const password = 'E2ePassword123!';
|
||||
@@ -79,8 +80,11 @@ test('[PRES-S01 S02 E07 E08 E09 J05 J09] Analytics native reports, direct entry,
|
||||
await page.getByRole('link', { name: 'Nordlys langsiktige karrieremuligheter æøå', exact: true }).click();
|
||||
await expect(page).toHaveURL(new RegExp(`/jobs\\?companyId=${companyId}$`));
|
||||
await expect(page.locator('[data-job-row-id]')).toHaveCount(6); await page.goBack();
|
||||
// Retained Dashboard flags must not remove the independent report destination.
|
||||
// A fully hidden saved Dashboard must not remove the independent report destination.
|
||||
await page.evaluate(owner => localStorage.setItem(`dashboardPrefs:${owner}`, JSON.stringify({ cards: false, activity: false, funnel: false, companies: false, skills: false })), me.id);
|
||||
const hidden = defaultDashboardLayout();
|
||||
hidden.widgets.forEach(widget => { widget.visible = false; });
|
||||
expect((await page.request.put(`${apiUrl}/auth/preferences/dashboard`, { headers, data: hidden })).status()).toBe(200);
|
||||
await page.goto('/dashboard'); await expect(page.getByText('Your dashboard sections are hidden.')).toBeVisible();
|
||||
await page.getByRole('button', { name: 'Analytics', exact: true }).click();
|
||||
await expect(activity.getByRole('table')).toBeVisible();
|
||||
|
||||
Reference in New Issue
Block a user