refactor: centralize event dialog form state
This commit is contained in:
16
tests/event-dialog.test.tsx
Normal file
16
tests/event-dialog.test.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
import { getEventFormValuesFromEvent } from "@/lib/event-form";
|
||||
|
||||
describe("EventDialog public modes", () => {
|
||||
test("accepts AI-prefilled editable initial values through its public props", () => {
|
||||
const initialValues = getEventFormValuesFromEvent({
|
||||
title: "AI Draft",
|
||||
start: "2026-04-09T10:00:00.000Z",
|
||||
recurrenceRule: "FREQ=WEEKLY;INTERVAL=1;BYDAY=TH",
|
||||
});
|
||||
|
||||
expect(initialValues.title).toBe("AI Draft");
|
||||
expect(initialValues.start).toBe("2026-04-09T10:00:00.000Z");
|
||||
expect(initialValues.recurrenceRule).toBe("FREQ=WEEKLY;INTERVAL=1;BYDAY=TH");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user