From db92f995428fb15d1bbef99a961a9695453b9cad Mon Sep 17 00:00:00 2001 From: Dmytro Stanchiev Date: Sun, 24 May 2026 22:12:29 -0400 Subject: [PATCH] test: add drawer.tsx to hook-driven files list --- tests/mobile-hook-adoption.test.ts | 83 +++++++++++++++--------------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/tests/mobile-hook-adoption.test.ts b/tests/mobile-hook-adoption.test.ts index 3a8d4e4..ae0c1f2 100644 --- a/tests/mobile-hook-adoption.test.ts +++ b/tests/mobile-hook-adoption.test.ts @@ -4,55 +4,54 @@ import { readFileSync } from "node:fs"; const RESPONSIVE_PREFIX_PATTERN = /\b(?:max-sm|sm:|md:|lg:|xl:|2xl:)/; const HOOK_DRIVEN_FILES = [ - "src/app/page.tsx", - "src/app/demo/combined-date-picker/page.tsx", - "src/components/ai-toolbar.tsx", - "src/components/event-dialog.tsx", - "src/components/settings-panel.tsx", - "src/components/ui/calendar.tsx", - "src/components/ui/date-picker.tsx", - "src/components/ui/dialog.tsx", - "src/components/ui/input-group.tsx", - "src/components/ui/textarea.tsx", - "src/lib/ui-shell-contract.ts", + "src/app/page.tsx", + "src/app/demo/combined-date-picker/page.tsx", + "src/components/ai-toolbar.tsx", + "src/components/event-dialog.tsx", + "src/components/settings-panel.tsx", + "src/components/ui/calendar.tsx", + "src/components/ui/date-picker.tsx", + "src/components/ui/dialog.tsx", + "src/components/ui/drawer.tsx", + "src/components/ui/input-group.tsx", + "src/components/ui/textarea.tsx", + "src/lib/ui-shell-contract.ts", ]; const DIRECT_HOOK_FILES = [ - "src/app/page.tsx", - "src/app/demo/combined-date-picker/page.tsx", - "src/components/ai-toolbar.tsx", - "src/components/event-dialog.tsx", - "src/components/settings-panel.tsx", - "src/components/ui/calendar.tsx", - "src/components/ui/date-picker.tsx", - "src/components/ui/dialog.tsx", - "src/components/ui/input-group.tsx", - "src/components/ui/textarea.tsx", + "src/app/page.tsx", + "src/app/demo/combined-date-picker/page.tsx", + "src/components/ai-toolbar.tsx", + "src/components/event-dialog.tsx", + "src/components/settings-panel.tsx", + "src/components/ui/calendar.tsx", + "src/components/ui/date-picker.tsx", + "src/components/ui/dialog.tsx", + "src/components/ui/input-group.tsx", + "src/components/ui/textarea.tsx", ]; -const BOOLEAN_HELPER_FILES = [ - "src/lib/ui-shell-contract.ts", -]; +const BOOLEAN_HELPER_FILES = ["src/lib/ui-shell-contract.ts"]; describe("mobile hook adoption", () => { - test("responsive source files stop using Tailwind breakpoint prefixes for mobile behavior", () => { - for (const filePath of HOOK_DRIVEN_FILES) { - const source = readFileSync(filePath, "utf8"); - expect(source).not.toMatch(RESPONSIVE_PREFIX_PATTERN); - } - }); + test("responsive source files stop using Tailwind breakpoint prefixes for mobile behavior", () => { + for (const filePath of HOOK_DRIVEN_FILES) { + const source = readFileSync(filePath, "utf8"); + expect(source).not.toMatch(RESPONSIVE_PREFIX_PATTERN); + } + }); - test("mobile-responsive component files explicitly depend on the shared useIsMobile hook", () => { - for (const filePath of DIRECT_HOOK_FILES) { - const source = readFileSync(filePath, "utf8"); - expect(source).toContain("useIsMobile"); - } - }); + test("mobile-responsive component files explicitly depend on the shared useIsMobile hook", () => { + for (const filePath of DIRECT_HOOK_FILES) { + const source = readFileSync(filePath, "utf8"); + expect(source).toContain("useIsMobile"); + } + }); - test("utility files accept isMobile booleans instead of embedding breakpoint strings", () => { - for (const filePath of BOOLEAN_HELPER_FILES) { - const source = readFileSync(filePath, "utf8"); - expect(source).toContain("isMobile"); - } - }); + test("utility files accept isMobile booleans instead of embedding breakpoint strings", () => { + for (const filePath of BOOLEAN_HELPER_FILES) { + const source = readFileSync(filePath, "utf8"); + expect(source).toContain("isMobile"); + } + }); });