package mappers import ( "testing" "apskel-pos-be/internal/models" "github.com/google/uuid" "github.com/stretchr/testify/require" ) func TestCreateCategoryRequestToEntityDefaultsToTeam(t *testing.T) { notTeam := false tests := []struct { name string isTeam *bool want bool }{ {name: "omitted is a team", isTeam: nil, want: true}, {name: "false is not a team", isTeam: ¬Team, want: false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { entity := CreateCategoryRequestToEntity(&models.CreateCategoryRequest{ OrganizationID: uuid.New(), Name: "Merchandise", IsTeam: tt.isTeam, }) require.Equal(t, tt.want, entity.IsTeam) }) } }