@@ -66,6 +66,7 @@ func TestSummarize(t *testing.T) {
6666 name string
6767 br healthsdk.BaseReport
6868 pfx string
69+ docsURL string
6970 expected []string
7071 }{
7172 {
@@ -93,9 +94,9 @@ func TestSummarize(t *testing.T) {
9394 expected : []string {
9495 "Error: testing" ,
9596 "Warn: TEST01: testing one" ,
96- "See: https://coder.com/docs/admin/healthcheck #test01" ,
97+ "See: https://coder.com/docs/admin/monitoring/health-check #test01" ,
9798 "Warn: TEST02: testing two" ,
98- "See: https://coder.com/docs/admin/healthcheck #test02" ,
99+ "See: https://coder.com/docs/admin/monitoring/health-check #test02" ,
99100 },
100101 },
101102 {
@@ -117,16 +118,40 @@ func TestSummarize(t *testing.T) {
117118 expected : []string {
118119 "TEST: Error: testing" ,
119120 "TEST: Warn: TEST01: testing one" ,
120- "See: https://coder.com/docs/admin/healthcheck #test01" ,
121+ "See: https://coder.com/docs/admin/monitoring/health-check #test01" ,
121122 "TEST: Warn: TEST02: testing two" ,
122- "See: https://coder.com/docs/admin/healthcheck#test02" ,
123+ "See: https://coder.com/docs/admin/monitoring/health-check#test02" ,
124+ },
125+ },
126+ {
127+ name : "custom docs url" ,
128+ br : healthsdk.BaseReport {
129+ Error : ptr .Ref ("testing" ),
130+ Warnings : []health.Message {
131+ {
132+ Code : "TEST01" ,
133+ Message : "testing one" ,
134+ },
135+ {
136+ Code : "TEST02" ,
137+ Message : "testing two" ,
138+ },
139+ },
140+ },
141+ docsURL : "https://my.coder.internal/docs" ,
142+ expected : []string {
143+ "Error: testing" ,
144+ "Warn: TEST01: testing one" ,
145+ "See: https://my.coder.internal/docs/admin/monitoring/health-check#test01" ,
146+ "Warn: TEST02: testing two" ,
147+ "See: https://my.coder.internal/docs/admin/monitoring/health-check#test02" ,
123148 },
124149 },
125150 } {
126151 tt := tt
127152 t .Run (tt .name , func (t * testing.T ) {
128153 t .Parallel ()
129- actual := tt .br .Summarize (tt .pfx , "" )
154+ actual := tt .br .Summarize (tt .pfx , tt . docsURL )
130155 if len (tt .expected ) == 0 {
131156 assert .Empty (t , actual )
132157 return
0 commit comments