veza/veza-backend-api/internal/services/kyc_service_test.go
senke 2281c91e8b feat(v0.13.5): polish marketplace & compliance — KYC, support, payout E2E
- Seller KYC via Stripe Identity (start verification, status check, webhook)
- Support ticket system (backend handler + frontend form page)
- E2E payout flow integration test (sale → payment → balance → payout)
- Migrations: seller_kyc columns, support_tickets table
- Frontend: SupportPage with SUMI design, lazy loading, routing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 14:57:19 +01:00

35 lines
801 B
Go

package services
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestMapStripeVerificationStatus(t *testing.T) {
tests := []struct {
input string
expected string
}{
{"verified", KYCStatusVerified},
{"requires_input", KYCStatusPending},
{"processing", KYCStatusPending},
{"canceled", KYCStatusFailed},
{"unknown", KYCStatusPending},
{"", KYCStatusPending},
}
for _, tc := range tests {
t.Run(tc.input, func(t *testing.T) {
result := mapStripeVerificationStatus(tc.input)
assert.Equal(t, tc.expected, result)
})
}
}
func TestKYCConstants(t *testing.T) {
assert.Equal(t, "not_started", KYCStatusNotStarted)
assert.Equal(t, "pending", KYCStatusPending)
assert.Equal(t, "verified", KYCStatusVerified)
assert.Equal(t, "failed", KYCStatusFailed)
}