From fa2405938a8def14d2652dd14f86871766fc1d63 Mon Sep 17 00:00:00 2001 From: Arthur Belleville Date: Sat, 16 May 2026 14:05:44 +0200 Subject: [PATCH] test(13-04): add failing tests for IconButton, UIIcon, Space, and Button icon wiring (RED) --- backend/internal/web/ui/ui_test.go | 67 ++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/backend/internal/web/ui/ui_test.go b/backend/internal/web/ui/ui_test.go index 6bab7f7..dcf0aa3 100644 --- a/backend/internal/web/ui/ui_test.go +++ b/backend/internal/web/ui/ui_test.go @@ -397,3 +397,70 @@ func TestTable_RendersShell(t *testing.T) { } } } + +// Phase 13 Plan 04 — IconButton, UIIcon, Space, and Button icon wiring tests (TDD RED) + +func TestIconButton_GhostNeutral(t *testing.T) { + out := render(t, context.Background(), IconButton(IconButtonProps{ + Icon: "plus", + Variant: IconButtonVariantNeutral, + Tone: IconButtonToneGhost, + Label: "Add", + })) + if !strings.Contains(out, "borderless-icon-button") { + t.Errorf("expected borderless-icon-button class; got: %s", out) + } + if !strings.Contains(out, `aria-label="Add"`) { + t.Errorf("expected aria-label=\"Add\"; got: %s", out) + } +} + +func TestIconButton_SolidDanger(t *testing.T) { + out := render(t, context.Background(), IconButton(IconButtonProps{ + Icon: "trash", + Variant: IconButtonVariantDanger, + Tone: IconButtonToneSolid, + Label: "Delete", + })) + if !strings.Contains(out, "ui-icon-button-solid") { + t.Errorf("expected ui-icon-button-solid class; got: %s", out) + } + if !strings.Contains(out, "ui-icon-button-danger") { + t.Errorf("expected ui-icon-button-danger class; got: %s", out) + } +} + +func TestUIIcon_Plus(t *testing.T) { + out := render(t, context.Background(), UIIcon("plus")) + if !strings.Contains(out, "