(t *testing.T)
| 16 | ) |
| 17 | |
| 18 | func 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. |
nothing calls this directly
no test coverage detected