mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
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.
This commit is contained in:
1 parent
da0229911b
commit
e3590e77bb
1 file changed
+10
-2
@@ -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 <CorrelationRow> behind a non-null analytics.correlations guard", () => {
|
||||
|
||||
Reference in new issue
Block a user