import { readFile } from "node:fs/promises"; import { describe, expect, it } from "vitest"; const editViewSource = await readFile( new URL("../src/settings/AutomationEditView.tsx", import.meta.url), "utf8", ); describe("automation schedule input height", () => { it("keeps every schedule state at 36px without wrapping added tags", () => { const readOnlyStart = editViewSource.indexOf( "{preserveSessionCreatedSchedule ? (", ); const addScheduleStart = editViewSource.indexOf( "{scheduleRemoved ? (", readOnlyStart, ); const selectedScheduleStart = editViewSource.indexOf( "调度栏原先使用 min-height", addScheduleStart, ); const selectedScheduleEnd = editViewSource.indexOf( " { expect(editViewSource).toContain( '"h-9 rounded-xl bg-input px-3 text-foreground"', ); expect(editViewSource).not.toContain( "rounded-lg border-transparent bg-card px-2", ); expect(editViewSource).toContain( "relative flex h-9 items-center overflow-hidden rounded-xl border border-input-border bg-input", ); expect(editViewSource).toContain( 'validationErrors.has("schedule")', ); expect(editViewSource).toContain( ': "border-input-border"', ); expect(editViewSource).toContain( "hover:border-input-border-hover", ); expect(editViewSource).toContain( "focus-within:border-input-border-focused", ); }); });