feat: deliver authenticated merchant analytics API

This commit is contained in:
2026-08-20 19:57:32 +03:30
parent b30e3439a4
commit d1c7b34388
8 changed files with 914 additions and 2 deletions

View 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)
}
}