package walletapi

import (
	"strings"
	"testing"
)

func TestVIPOnlineNoticeMessageUsesConfiguredValueAndSafeFallbacks(t *testing.T) {
	if got := vipOnlineNoticeMessage("{"); got != "欢迎进入，祝你有美好的一天" {
		t.Fatalf("fallback mismatch: %q", got)
	}
	if got := vipOnlineNoticeMessage(`{"message":"  Lalu VIP online  "}`); got != "Lalu VIP online" {
		t.Fatalf("configured message mismatch: %q", got)
	}
	if got := vipOnlineNoticeMessage(`{"message":"` + strings.Repeat("x", 257) + `"}`); got != "欢迎进入，祝你有美好的一天" {
		t.Fatalf("oversized message fallback mismatch: %q", got)
	}
}
