MCPcopy Create free account
hub / github.com/algolia/cli / TestDashboardURL

Function TestDashboardURL

pkg/cmd/open/open_test.go:18–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

16)
17
18func TestDashboardURL(t *testing.T) {
19 base := "https://dashboard.algolia.com"
20 tests := []struct {
21 shortcut string
22 want string
23 }{
24 {"dashboard", "https://dashboard.algolia.com/apps/APP123/dashboard"},
25 {"indices", "https://dashboard.algolia.com/apps/APP123/explorer/browse"},
26 {"crawler", "https://dashboard.algolia.com/apps/APP123/crawler"},
27 {"connectors", "https://dashboard.algolia.com/apps/APP123/connectors"},
28 {"api-keys", "https://dashboard.algolia.com/account/api-keys/all?applicationId=APP123"},
29 {"usage", "https://dashboard.algolia.com/account/billing/usage?applicationId=APP123"},
30 {"team", "https://dashboard.algolia.com/account/teams?applicationId=APP123"},
31 {"billing", "https://dashboard.algolia.com/account/billing/details?applicationId=APP123"},
32 {"cost-management", "https://dashboard.algolia.com/account/billing/cost-management?applicationId=APP123"},
33 }
34
35 for _, tt := range tests {
36 t.Run(tt.shortcut, func(t *testing.T) {
37 assert.Equal(t, tt.want, dashboardURL(base, "APP123", dashboardTargets[tt.shortcut]))
38 })
39 }
40}
41
42// TestTargetNamesNoCollision guards against a shortcut existing in both maps,
43// which would make its behavior ambiguous.

Callers

nothing calls this directly

Calls 2

dashboardURLFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected