From e3590e77bb73a748565c8824e5d149bb550ec759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sat, 16 May 2026 18:07:20 +0200 Subject: [PATCH] test(insights): align b3-wiring import guard with next/dynamic wrapping The page now resolves CorrelationRow and TrendsRow through dynamic() imports rather than top-level `from "..."` statements; the static-source scan accepts either spelling so a future revert to eager imports still flags the load-bearing module path. --- src/app/__tests__/insights-b3-wiring.test.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/__tests__/insights-b3-wiring.test.ts b/src/app/__tests__/insights-b3-wiring.test.ts index edb5920e4..feb706aa4 100644 --- a/src/app/__tests__/insights-b3-wiring.test.ts +++ b/src/app/__tests__/insights-b3-wiring.test.ts @@ -26,9 +26,17 @@ function load(path: string): string { describe("v1.4.20 B3 — /insights mounts CorrelationRow + TrendsRow", () => { it("imports both new components", () => { + // v1.4.33 IW2 deferred below-the-fold blocks behind `next/dynamic`, + // so the static `from "..."` import-string was replaced with a + // `dynamic(() => import("..."))` call. Either spelling counts as + // a load-bearing reference to the module path. const src = load(INSIGHTS_PATH); - expect(src).toContain('from "@/components/insights/correlation-row"'); - expect(src).toContain('from "@/components/insights/trends-row"'); + expect(src).toMatch( + /(?:from\s+"@\/components\/insights\/correlation-row"|import\("@\/components\/insights\/correlation-row"\))/, + ); + expect(src).toMatch( + /(?:from\s+"@\/components\/insights\/trends-row"|import\("@\/components\/insights\/trends-row"\))/, + ); }); it("mounts behind a non-null analytics.correlations guard", () => {