package product

import (
	"testing"

	"leadb2b.org/internal/api"
)

func TestHasWhatsAppHeuristic(t *testing.T) {
	ddd := "11"
	tel := "998877665"
	item := api.EstabelecimentoOut{DDD1: &ddd, Telefone1: &tel}
	if !HasWhatsApp(item) {
		t.Fatal("expected whatsapp heuristic true for mobile")
	}
	land := "33334444"
	item2 := api.EstabelecimentoOut{DDD1: &ddd, Telefone1: &land}
	if HasWhatsApp(item2) {
		t.Fatal("landline should not match whatsapp heuristic")
	}
}
