managarten/services/mana-notify/internal/channel/push_test.go
Till JS 7e931b1c6d refactor(services): rename Go services, remove -go suffix
mana-search-go → mana-search
mana-notify-go → mana-notify
mana-crawler-go → mana-crawler
mana-api-gateway-go → mana-api-gateway

Legacy NestJS versions are deleted, suffix no longer needed.
Updated all references in docker-compose, CLAUDE.md, package.json,
Forgejo workflows, and service package.json files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 10:18:40 +01:00

31 lines
762 B
Go

package channel
import "testing"
func TestIsExpoPushToken(t *testing.T) {
tests := []struct {
token string
want bool
}{
{"ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]", true},
{"ExpoPushToken[xxxxxxxxxxxxxxxxxxxxxx]", true},
{"ExponentPushToken[abc123]", true},
{"ExpoPushToken[abc123]", true},
{"ExponentPushToken[]", true},
{"", false},
{"some-random-token", false},
{"Bearer ExponentPushToken[abc]", false},
{"exponentpushtoken[abc]", false}, // case sensitive
{"ExpoPush[abc]", false},
{"fcm:token123", false},
}
for _, tt := range tests {
t.Run(tt.token, func(t *testing.T) {
got := IsExpoPushToken(tt.token)
if got != tt.want {
t.Fatalf("IsExpoPushToken(%q) = %v, want %v", tt.token, got, tt.want)
}
})
}
}