- 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>
35 lines
801 B
Go
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)
|
|
}
|