Initial commit

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 13:57:10 +08:00
co-authored by Claude Opus 5
commit 8679200f41
1897 changed files with 257900 additions and 0 deletions
@@ -0,0 +1,39 @@
package usermod
import (
"testing"
"time"
)
func TestGetPaymentStatusPopupNewUserIgnoresFreeWatchCount(t *testing.T) {
now := time.Now()
tests := []struct {
name string
watchCount uint64
want string
}{
{
name: "remaining free views stays new unpaid",
watchCount: 3,
want: UserPaymentStatusPopupNewUnpay,
},
{
name: "exhausted free views stays new unpaid",
watchCount: 0,
want: UserPaymentStatusPopupNewUnpay,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
user := &User{
CreatedAt: now.Add(-time.Hour),
WatchCount: tt.watchCount,
}
if got := user.GetPaymentStatusPopup(); got != tt.want {
t.Fatalf("GetPaymentStatusPopup() = %q, want %q", got, tt.want)
}
})
}
}