test(dashboard): qualify responsive layout and preview semantics
This commit is contained in:
@@ -363,7 +363,7 @@ export default function DashboardView({ mode = "dashboard" }: { mode?: "dashboar
|
||||
{summaryReady && hasJobs ? <Box sx={grid}>{reports.stageAge}{reports.sources}</Box> : null}
|
||||
{reports.salary}
|
||||
<Box sx={grid}>{reports.companies}{reports.skills}</Box>
|
||||
</> : <Box aria-label={layoutState.editing ? t("dashboardPreview") : undefined} sx={{ display: "grid", gridTemplateColumns: { xs: "minmax(0, 1fr)", md: "repeat(2, minmax(0, 1fr))" }, gap: 3, alignItems: "start" }}>
|
||||
</> : <Box role={layoutState.editing ? "region" : undefined} aria-label={layoutState.editing ? t("dashboardPreview") : undefined} sx={{ display: "grid", gridTemplateColumns: { xs: "minmax(0, 1fr)", md: "repeat(2, minmax(0, 1fr))" }, gap: 3, alignItems: "start" }}>
|
||||
{activeLayout.widgets.filter(widget => widget.visible).map(widget => {
|
||||
const content = reports[widget.id];
|
||||
const ready = widget.id === "activity" || widget.id === "skills" ? trendsReady : summaryReady;
|
||||
|
||||
@@ -31,6 +31,7 @@ async function edit() { fireEvent.click(await screen.findByRole('button', { name
|
||||
test('visibility is a preview; cancel restores the saved layout without a write', async () => {
|
||||
open(); await screen.findByText('Tracked jobs');
|
||||
const editor = await edit(); fireEvent.click(within(editor).getByRole('checkbox', { name: 'Summary cards' }));
|
||||
expect(screen.getByRole('region', { name: 'Dashboard preview' })).toBeInTheDocument();
|
||||
expect(screen.queryByText('Tracked jobs')).not.toBeInTheDocument();
|
||||
fireEvent.click(within(editor).getByRole('button', { name: 'Cancel' }));
|
||||
const dialog = await screen.findByRole('dialog'); fireEvent.click(within(dialog).getByRole('button', { name: 'Discard changes' }));
|
||||
|
||||
Reference in New Issue
Block a user