import { describe, expect, it } from "vitest"; import vehicleDemandSource from "@/pages/vehicle-demand.vue?raw"; describe("vehicle demand form layout", () => { it("keeps native inputs and textarea inside their responsive parent width", () => { const fieldClasses = [ ...vehicleDemandSource.matchAll(/<(?:input|textarea)\b[^>]*\sclass="([^"]+)"/g), ].map((match) => match[1].split(/\s+/)); expect(fieldClasses).toHaveLength(7); expect(fieldClasses.every((classes) => classes.includes("box-border"))).toBe(true); expect(fieldClasses.every((classes) => classes.includes("min-w-0"))).toBe(true); }); it("allows the two-column passenger fields to shrink within the form card", () => { expect(vehicleDemandSource).toContain('class="grid min-w-0 grid-cols-2 gap-3"'); expect(vehicleDemandSource).toContain('class="min-w-0"'); }); });