package parser_test

import (
	"testing"

	"bit.admedia.com/scm/ad/adpilot-indexing-code-parser.com/internal/service/parser"
)

func TestIsIgnoredPath(t *testing.T) {
	tests := []struct {
		path   string
		ignore bool
	}{
		{path: ".gitignore", ignore: true},
		{path: "package-lock.json", ignore: true},
		{path: "frontend/yarn.lock", ignore: true},
		{path: "pnpm-lock.yaml", ignore: true},
		{path: "dist/app.min.js", ignore: true},
		{path: "scripts/fixtures/PRH-book-hamnet.html", ignore: true},
		{path: "test/fixtures/sample.html", ignore: true},
		{path: "tests/fixtures/page.html", ignore: true},
		{path: "__fixtures__/auth.html", ignore: true},
		{path: "crawl-api/src/site.ts", ignore: false},
		{path: "internal/main.go", ignore: false},
		{path: "src/App.tsx", ignore: false},
		{path: "styles/main.css", ignore: false},
	}

	for _, tt := range tests {
		t.Run(tt.path, func(t *testing.T) {
			if got := parser.IsIgnoredPath(tt.path); got != tt.ignore {
				t.Fatalf("IsIgnoredPath(%q) = %v, want %v", tt.path, got, tt.ignore)
			}
		})
	}
}
