Commit 17d391f
committed
test(enterprise): improve embeddable dashboard endpoint tests
- Remove 3 empty lines between test cases
- Make Tallyman URL configurable via enterprise/coderd.Options
- Add TallymanURL field as pre-parsed *url.URL
- Pass through to tallymansdk.New for testing
- Add comprehensive tests with httptest fake server:
- Success: validates happy path with proper auth headers
- WithColorOverrides: validates color override pass-through
- UntrustedHostRejected: validates security check for non-metronome.com domains
- TallymanServerError: validates error handling from Tallyman
- InvalidDashboardType: validates invalid dashboard type returns 400
- Add dashboard type validation in handler
- Use tallymansdk structs instead of map[string]interface{} in tests
- Use assert instead of require in HTTP handlers (safe for non-test goroutines)
- Simplify httptest.NewServer calls by using HandlerFunc directly
- Make codersdk dashboard type an enum (UsageEmbeddableDashboardType)
- Add nolint comments for owner user usage (required for license access)
Made by cmux1 parent f8ce104 commit 17d391f
File tree
10 files changed
+266
-20
lines changed- coderd/apidoc
- codersdk
- docs/reference/api
- enterprise/coderd
- coderdenttest
- site/src/api
10 files changed
+266
-20
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
138 | 146 | | |
139 | 147 | | |
140 | | - | |
141 | | - | |
| 148 | + | |
| 149 | + | |
142 | 150 | | |
143 | 151 | | |
144 | 152 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
671 | 671 | | |
672 | 672 | | |
673 | 673 | | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
674 | 677 | | |
675 | 678 | | |
676 | 679 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| 81 | + | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| |||
120 | 122 | | |
121 | 123 | | |
122 | 124 | | |
| 125 | + | |
123 | 126 | | |
124 | 127 | | |
125 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
410 | 420 | | |
411 | 421 | | |
412 | 422 | | |
| |||
421 | 431 | | |
422 | 432 | | |
423 | 433 | | |
| 434 | + | |
424 | 435 | | |
425 | 436 | | |
426 | 437 | | |
| |||
0 commit comments