package authentik

import "testing"

func TestAPIBaseURL(t *testing.T) {
	t.Parallel()
	cases := map[string]string{
		"http://authentik-server:9000":      "http://authentik-server:9000/auth",
		"http://authentik-server:9000/":     "http://authentik-server:9000/auth",
		"http://authentik-server:9000/auth": "http://authentik-server:9000/auth",
		"http://authentik-server:9000/auth/": "http://authentik-server:9000/auth",
		"": "http://authentik-server:9000/auth",
	}
	for in, want := range cases {
		if got := APIBaseURL(in); got != want {
			t.Fatalf("APIBaseURL(%q) = %q, want %q", in, got, want)
		}
	}
}
