MCPcopy Index your code
hub / github.com/coder/coder / TestCustomDocsURL

Function TestCustomDocsURL

enterprise/coderd/appearance_test.go:241–258  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

239}
240
241func TestCustomDocsURL(t *testing.T) {
242 t.Parallel()
243
244 testURLRawString := "http://google.com"
245 testURL, err := url.Parse(testURLRawString)
246 require.NoError(t, err)
247 cfg := coderdtest.DeploymentValues(t)
248 cfg.DocsURL = *serpent.URLOf(testURL)
249 adminClient, adminUser := coderdenttest.New(t, &coderdenttest.Options{DontAddLicense: true, Options: &coderdtest.Options{DeploymentValues: cfg}})
250 anotherClient, _ := coderdtest.CreateAnotherUser(t, adminClient, adminUser.OrganizationID)
251
252 ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitMedium)
253 defer cancel()
254
255 appr, err := anotherClient.Appearance(ctx)
256 require.NoError(t, err)
257 require.Equal(t, testURLRawString, appr.DocsURL)
258}
259
260func TestDefaultSupportLinksWithCustomDocsUrl(t *testing.T) {
261 t.Parallel()

Callers

nothing calls this directly

Calls 6

DeploymentValuesFunction · 0.92
NewFunction · 0.92
CreateAnotherUserFunction · 0.92
AppearanceMethod · 0.80
ParseMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected