go-htmx-gsd #1
1 changed files with 61 additions and 0 deletions
|
|
@ -130,3 +130,64 @@ func TestNormalizers_ZeroValueDefaults(t *testing.T) {
|
|||
t.Errorf("NormalizedBadgeVariant(\"\") = %q; want %q", got, BadgeVariantInfo)
|
||||
}
|
||||
}
|
||||
|
||||
// Phase 13 Plan 01 — new enum and class function tests (TDD RED)
|
||||
|
||||
func TestButtonVariantGhost_Normalizer(t *testing.T) {
|
||||
got := NormalizedButtonVariant(ButtonVariantGhost)
|
||||
if got != ButtonVariantGhost {
|
||||
t.Errorf("NormalizedButtonVariant(ButtonVariantGhost) = %q; want %q", got, ButtonVariantGhost)
|
||||
}
|
||||
}
|
||||
|
||||
func TestButtonClass_GhostVariant(t *testing.T) {
|
||||
got := ButtonClass(ButtonVariantGhost, ButtonToneSolid, SizeMD)
|
||||
if !strings.Contains(got, "ui-button-ghost") {
|
||||
t.Errorf("ButtonClass(Ghost, Solid, MD) = %q; want to contain \"ui-button-ghost\"", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBadgeVariantPrimary_Normalizer(t *testing.T) {
|
||||
got := NormalizedBadgeVariant(BadgeVariantPrimary)
|
||||
if got != BadgeVariantPrimary {
|
||||
t.Errorf("NormalizedBadgeVariant(BadgeVariantPrimary) = %q; want %q", got, BadgeVariantPrimary)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBadgeClass_PrimaryVariant(t *testing.T) {
|
||||
got := BadgeClass(BadgeVariantPrimary)
|
||||
want := "ui-badge ui-badge-primary"
|
||||
if got != want {
|
||||
t.Errorf("BadgeClass(BadgeVariantPrimary) = %q; want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIconButtonClass_GhostNeutral(t *testing.T) {
|
||||
got := IconButtonClass(IconButtonVariantNeutral, IconButtonToneGhost)
|
||||
if !strings.Contains(got, "borderless-icon-button") {
|
||||
t.Errorf("IconButtonClass(Neutral, Ghost) = %q; want to contain \"borderless-icon-button\"", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIconButtonClass_SolidNeutral(t *testing.T) {
|
||||
got := IconButtonClass(IconButtonVariantNeutral, IconButtonToneSolid)
|
||||
if !strings.Contains(got, "ui-icon-button-solid") {
|
||||
t.Errorf("IconButtonClass(Neutral, Solid) = %q; want to contain \"ui-icon-button-solid\"", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSpaceXClass_MD(t *testing.T) {
|
||||
got := SpaceXClass(SpacingStepMD)
|
||||
want := "ui-space-x ui-space-x-md"
|
||||
if got != want {
|
||||
t.Errorf("SpaceXClass(SpacingStepMD) = %q; want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSpaceYClass_LG(t *testing.T) {
|
||||
got := SpaceYClass(SpacingStepLG)
|
||||
want := "ui-space-y ui-space-y-lg"
|
||||
if got != want {
|
||||
t.Errorf("SpaceYClass(SpacingStepLG) = %q; want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue