feat: deliver authenticated merchant analytics API
This commit is contained in:
30
internal/api/server_test.go
Normal file
30
internal/api/server_test.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package api
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestServerCookieName(t *testing.T) {
|
||||
t.Parallel()
|
||||
tests := []struct {
|
||||
name string
|
||||
secure bool
|
||||
expected string
|
||||
}{
|
||||
{name: "local development", secure: false, expected: "zpa_session"},
|
||||
{name: "secure deployment", secure: true, expected: "__Host-zpa_session"},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
server := &Server{cookieSecure: tt.secure}
|
||||
if got := server.cookieName(); got != tt.expected {
|
||||
t.Fatalf("cookieName() = %q, want %q", got, tt.expected)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestPersianStatus(t *testing.T) {
|
||||
t.Parallel()
|
||||
if got := persianStatus("Verified"); got != "تأیید شده" {
|
||||
t.Fatalf("persianStatus() = %q", got)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user