package walletapi

import "testing"

func TestCoinSellerWhatsAppURL(t *testing.T) {
	tests := []struct {
		name string
		raw  string
		want string
	}{
		{name: "phone number", raw: "+65 1234 5678", want: "https://wa.me/6512345678"},
		{name: "wa me link", raw: "https://wa.me/6512345678", want: "https://wa.me/6512345678"},
		{name: "whatsapp scheme", raw: "whatsapp://send?phone=6512345678", want: "whatsapp://send?phone=6512345678"},
		{name: "blank contact", raw: " ", want: ""},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if got := coinSellerWhatsAppURL(tt.raw); got != tt.want {
				t.Fatalf("coinSellerWhatsAppURL(%q)=%q, want %q", tt.raw, got, tt.want)
			}
		})
	}
}
