package authproxy import ( "testing" "github.com/stretchr/testify/assert" ) func TestAllowedOrigins(t *testing.T) { testCases := []struct { title string cfg *ProxyConfig expected int }{ { title: "Test Case 1", cfg: &ProxyConfig{ AllowedOrigins: "http://localhost:3000,https://*.edge-preprod.dev", }, expected: 2, }, { title: "Test Case 2", cfg: &ProxyConfig{ AllowedOrigins: "", }, expected: 1, }, { title: "Test Case 3", cfg: &ProxyConfig{ AllowedOrigins: "http://localhost:3000,https://*.edge-preprod.dev,https://google.com", }, expected: 3, }, } for _, testCase := range testCases { t.Run(testCase.title, func(t *testing.T) { assert.Equal(t, len(testCase.cfg.allowedOrigins()), testCase.expected) }) } }