From a371678460fead11d7bac96a6a268d413123fe55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Fri, 19 Jun 2026 21:18:27 +0200 Subject: [PATCH] test(coach): guard composer controls against the sub-44px floor Assert the send and stop controls render the `size-11 sm:size-9` tap- target pattern so a future restyle cannot quietly drop them back to the 36px size the audit flagged. Renders the real component and matches the emitted class string, the same model as the bottom-nav size test. --- .../__tests__/coach-input.test.tsx | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/components/insights/coach-panel/__tests__/coach-input.test.tsx b/src/components/insights/coach-panel/__tests__/coach-input.test.tsx index b59b383c0..ea73deed7 100644 --- a/src/components/insights/coach-panel/__tests__/coach-input.test.tsx +++ b/src/components/insights/coach-panel/__tests__/coach-input.test.tsx @@ -175,6 +175,39 @@ describe("", () => { expect(html).toContain("Stopp"); }); + it("sizes the send control to the 44px tap-target floor on phones", () => { + // v1.18.7 — the composer controls (send / stop / mic) must clear the + // 44px WCAG 2.5.5 floor on phones and condense at `sm:` upward. Guard + // the `size-11 sm:size-9` pattern so a future restyle can't quietly + // drop the send button back to 36px. + const html = render( + {}} onSubmit={() => {}} />, + ); + const sendTag = html.match( + /]*data-slot="coach-input-send"[^>]*>/, + ); + expect(sendTag?.[0]).toMatch(/\bsize-11\b/); + expect(sendTag?.[0]).toMatch(/\bsm:size-9\b/); + }); + + it("sizes the stop control to the 44px tap-target floor on phones", () => { + const html = render( + {}} + onSubmit={() => {}} + onCancel={() => {}} + disabled + isStreaming + />, + ); + const stopTag = html.match( + /]*data-slot="coach-input-stop"[^>]*>/, + ); + expect(stopTag?.[0]).toMatch(/\bsize-11\b/); + expect(stopTag?.[0]).toMatch(/\bsm:size-9\b/); + }); + it("invokes onChange when the parent passes a controlled handler", () => { // SSR can't fire DOM events; smoke-check the contract by calling // the supplied handler directly.