| 9 | ) |
| 10 | |
| 11 | func Test_MessageURL(t *testing.T) { |
| 12 | t.Parallel() |
| 13 | |
| 14 | for _, tt := range []struct { |
| 15 | name string |
| 16 | code health.Code |
| 17 | base string |
| 18 | expected string |
| 19 | }{ |
| 20 | {"empty", "", "", "https://coder.com/docs/admin/monitoring/health-check#eunknown"}, |
| 21 | {"default", health.CodeAccessURLFetch, "", "https://coder.com/docs/admin/monitoring/health-check#eacs03"}, |
| 22 | {"custom docs base", health.CodeAccessURLFetch, "https://example.com/docs", "https://example.com/docs/admin/monitoring/health-check#eacs03"}, |
| 23 | } { |
| 24 | t.Run(tt.name, func(t *testing.T) { |
| 25 | t.Parallel() |
| 26 | uut := health.Message{Code: tt.code} |
| 27 | actual := uut.URL(tt.base) |
| 28 | assert.Equal(t, tt.expected, actual) |
| 29 | }) |
| 30 | } |
| 31 | } |