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

Function TestCustomSupportLinks

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

Source from the content-addressed store, hash-verified

188}
189
190func TestCustomSupportLinks(t *testing.T) {
191 t.Parallel()
192
193 supportLinks := []codersdk.LinkConfig{
194 {
195 Name: "First link",
196 Target: "http://first-link-1",
197 Icon: "chat",
198 },
199 {
200 Name: "Second link",
201 Target: "http://second-link-2",
202 Icon: "bug",
203 },
204 {
205 Name: "First button",
206 Target: "http://first-button-1",
207 Icon: "bug",
208 Location: "navbar",
209 },
210 {
211 Name: "Third link",
212 Target: "http://third-link-3",
213 Icon: "star",
214 },
215 }
216 cfg := coderdtest.DeploymentValues(t)
217 cfg.Support.Links = serpent.Struct[[]codersdk.LinkConfig]{
218 Value: supportLinks,
219 }
220
221 adminClient, adminUser := coderdenttest.New(t, &coderdenttest.Options{
222 Options: &coderdtest.Options{
223 DeploymentValues: cfg,
224 },
225 LicenseOptions: &coderdenttest.LicenseOptions{
226 Features: license.Features{
227 codersdk.FeatureAppearance: 1,
228 },
229 },
230 })
231
232 anotherClient, _ := coderdtest.CreateAnotherUser(t, adminClient, adminUser.OrganizationID)
233 ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitMedium)
234 defer cancel()
235
236 appr, err := anotherClient.Appearance(ctx)
237 require.NoError(t, err)
238 require.Equal(t, supportLinks, appr.SupportLinks)
239}
240
241func TestCustomDocsURL(t *testing.T) {
242 t.Parallel()

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected