Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add test
  • Loading branch information
bcpeinhardt committed Aug 5, 2024
commit e95fb052b0bcfeb55137161ace4dc4331c0c41c2
21 changes: 21 additions & 0 deletions enterprise/coderd/appearance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"net/http"
"net/url"
"testing"

"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -229,6 +230,26 @@ func TestCustomSupportLinks(t *testing.T) {
require.Equal(t, supportLinks, appr.SupportLinks)
}

func TestDefaultSupportLinksWithCustomDocsUrl(t *testing.T) {
t.Parallel()

// Don't need to set the license, as default links are passed without it.
testURLRawString := "http://google.com"
testURL, err := url.Parse(testURLRawString)
require.NoError(t, err)
cfg := coderdtest.DeploymentValues(t)
cfg.DocsURL = *serpent.URLOf(testURL)
adminClient, adminUser := coderdenttest.New(t, &coderdenttest.Options{DontAddLicense: true, Options: &coderdtest.Options{DeploymentValues: cfg}})
anotherClient, _ := coderdtest.CreateAnotherUser(t, adminClient, adminUser.OrganizationID)

ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitMedium)
defer cancel()

appr, err := anotherClient.Appearance(ctx)
require.NoError(t, err)
require.Equal(t, appearance.DefaultSupportLinks(testURLRawString), appr.SupportLinks)
}

func TestDefaultSupportLinks(t *testing.T) {
t.Parallel()

Expand Down
Loading