From b690c8fb97898306206c516b2b753788ba7d7da0 Mon Sep 17 00:00:00 2001 From: WhiteMuush Date: Sat, 11 Jul 2026 13:35:32 +0200 Subject: [PATCH] fix: wrap widget library in DetailDrawerProvider --- e2e/smoke.spec.ts | 10 ++++++++++ src/app/(dashboard)/dashboard/widgets/page.tsx | 13 ++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/e2e/smoke.spec.ts b/e2e/smoke.spec.ts index b49961f..e53b6a9 100644 --- a/e2e/smoke.spec.ts +++ b/e2e/smoke.spec.ts @@ -1,19 +1,25 @@ import { test, expect } from "@playwright/test" let cspViolations: string[] +let pageErrors: string[] test.beforeEach(({ page }) => { cspViolations = [] + pageErrors = [] page.on("console", (msg) => { const text = msg.text() if (text.includes("Content Security Policy") || text.includes("Refused to")) { cspViolations.push(text) } }) + page.on("pageerror", (err) => { + pageErrors.push(err.message) + }) }) test.afterEach(() => { expect(cspViolations).toEqual([]) + expect(pageErrors).toEqual([]) }) test("admin signs in, sees dashboard and alerts", async ({ page }) => { @@ -27,4 +33,8 @@ test("admin signs in, sees dashboard and alerts", async ({ page }) => { await page.goto("/alerts") await expect(page.getByRole("main")).toBeVisible() + + await page.goto("/dashboard/widgets") + await expect(page.getByRole("heading", { name: "Widget Library" })).toBeVisible() + await expect(page.getByRole("heading", { name: "Alert Severity" })).toBeVisible() }) diff --git a/src/app/(dashboard)/dashboard/widgets/page.tsx b/src/app/(dashboard)/dashboard/widgets/page.tsx index d548ce8..40be2ba 100644 --- a/src/app/(dashboard)/dashboard/widgets/page.tsx +++ b/src/app/(dashboard)/dashboard/widgets/page.tsx @@ -3,6 +3,7 @@ import { getDashboardData } from "@/lib/dashboard" import { prisma } from "@/lib/prisma" import { WIDGETS } from "@/lib/widgetRegistry" import { WidgetLibrary } from "@/components/dashboard/WidgetLibrary" +import { DetailDrawerProvider } from "@/contexts/DetailDrawerContext" import { StatsRow } from "@/components/dashboard/StatsRow" import { TrendChart } from "@/components/dashboard/TrendChart" import { DataTypeBreakdown } from "@/components/dashboard/DataTypeBreakdown" @@ -86,10 +87,12 @@ export default async function WidgetsPage() { } return ( - + + + ) }