package components_test import ( "fmt" "testing" "git.sapphic.engineer/roleypoly/v4/templates/components" "git.sapphic.engineer/roleypoly/v4/templates/templatetesting" "git.sapphic.engineer/roleypoly/v4/types" "git.sapphic.engineer/roleypoly/v4/types/fixtures" "git.sapphic.engineer/roleypoly/v4/utils" "github.com/stretchr/testify/assert" ) func TestCategoryTemplate(t *testing.T) { c := components.CategoryTemplateData{ ID: "123", Name: "Multi", Type: types.CategoryMultiple, Roles: []components.RoleTemplateData{ components.Role(&fixtures.CategoryMulti, &fixtures.RoleWithDarkColor, true, true), }, } html := templatetesting.Template(t, "components/category", c) assert.Contains(t, html, "

Multi

", "has header") assert.Contains(t, html, `data-testid="category-123"`, "has testid") assert.NotContains(t, html, `Single", "has header") assert.Contains(t, html, `data-testid="category-456"`, "has testid") assert.NotContains(t, html, `