package threadsapi

import "testing"

func TestMapInsightMetrics(t *testing.T) {
	stats := mapInsightMetrics(map[string]int{
		"likes":   10,
		"replies": 3,
		"reposts": 2,
		"quotes":  1,
		"views":   99,
		"shares":  4,
	})
	if stats.LikeCount != 10 || stats.ReplyCount != 3 || stats.RepostCount != 2 || stats.QuoteCount != 1 {
		t.Fatalf("unexpected counts: %+v", stats)
	}
	if stats.Views != 99 || stats.Shares != 4 {
		t.Fatalf("unexpected views/shares: %+v", stats)
	}
}

func TestMapInsightMetricsEmpty(t *testing.T) {
	stats := mapInsightMetrics(nil)
	if stats.LikeCount != 0 || stats.ReplyCount != 0 {
		t.Fatalf("expected zero stats, got %+v", stats)
	}
}
