test: add failing tests for Drawer mobile branch in EventDialog
This commit is contained in:
@@ -30,4 +30,62 @@ describe("EventDialog public modes", () => {
|
||||
expect(source).toContain("Schedule");
|
||||
expect(source).toContain("Recurrence");
|
||||
});
|
||||
|
||||
test("event-dialog imports Drawer for mobile branch", () => {
|
||||
const source = readFileSync("src/components/event-dialog.tsx", "utf8");
|
||||
|
||||
expect(source).toContain('from "@/components/ui/drawer"');
|
||||
});
|
||||
|
||||
test("event-dialog renders three step components", () => {
|
||||
const source = readFileSync("src/components/event-dialog.tsx", "utf8");
|
||||
|
||||
expect(source).toContain("DetailsStep");
|
||||
expect(source).toContain("ScheduleStep");
|
||||
expect(source).toContain("RecurrenceStep");
|
||||
});
|
||||
|
||||
test("event-dialog includes step progress bars", () => {
|
||||
const source = readFileSync("src/components/event-dialog.tsx", "utf8");
|
||||
|
||||
expect(source).toContain("grid-cols-3");
|
||||
});
|
||||
|
||||
test("event-dialog includes step counter badge", () => {
|
||||
const source = readFileSync("src/components/event-dialog.tsx", "utf8");
|
||||
|
||||
expect(source).toContain("/ 3");
|
||||
});
|
||||
|
||||
test("drawer footer shows Cancel on step 1 and Back on steps 2 and 3", () => {
|
||||
const source = readFileSync("src/components/event-dialog.tsx", "utf8");
|
||||
|
||||
expect(source).toContain("Cancel");
|
||||
expect(source).toContain("Back");
|
||||
});
|
||||
|
||||
test("drawer footer shows Save only on step 3", () => {
|
||||
const source = readFileSync("src/components/event-dialog.tsx", "utf8");
|
||||
|
||||
expect(source).toContain("Save");
|
||||
expect(source).toContain("Next");
|
||||
});
|
||||
|
||||
test("event-dialog resets step to 1 on close", () => {
|
||||
const source = readFileSync("src/components/event-dialog.tsx", "utf8");
|
||||
|
||||
expect(source).toContain("setStep(1)");
|
||||
});
|
||||
|
||||
test("dialog.tsx no longer forks on isMobile in DialogContent", () => {
|
||||
const source = readFileSync("src/components/ui/dialog.tsx", "utf8");
|
||||
|
||||
expect(source).not.toContain('isMobile ? undefined : "max-w-lg"');
|
||||
});
|
||||
|
||||
test("dialog.tsx no longer forks on isMobile in DialogFooter", () => {
|
||||
const source = readFileSync("src/components/ui/dialog.tsx", "utf8");
|
||||
|
||||
expect(source).not.toContain('isMobile\n\t\t\t\t? "flex flex-col-reverse gap-2"');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user