test(ai-toolbar): harden stacked preview regression

This commit is contained in:
2026-04-22 17:37:54 -04:00
parent 7b61703b01
commit f5058803b6

View File

@@ -187,9 +187,18 @@ describe("AI capture redesign", () => {
test("attachment previews stack one per row instead of using a two-column desktop grid", () => {
const source = readToolbarSource();
const previewGridClassName = source.match(
/className="([^"]*\bmt-3\b[^"]*\bgrid\b[^"]*\bgap-2\b[^"]*)"/,
)?.[1];
expect(source).not.toContain('"mt-3 grid gap-2 grid-cols-2"');
expect(source).toContain('"mt-3 grid gap-2"');
expect(previewGridClassName).toBeDefined();
expect(previewGridClassName).toMatch(/\bmt-3\b/);
expect(previewGridClassName).toMatch(/\bgrid\b/);
expect(previewGridClassName).toMatch(/\bgap-2\b/);
expect(previewGridClassName).not.toMatch(
/(?:^|\s)(?:[a-z]+:)*grid-cols-(?:\[[^\]]+\]|\S+)/,
);
});
});