mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: move proxy settings page to deployment options (#8246)
* feat: Move workspace proxy page to deployment options Workspace proxy settings page is now an admin feature * WorkspaceProxy response extends region
This commit is contained in:
@@ -49,6 +49,11 @@ type tableTest3 struct {
|
||||
Sub tableTest2 `table:"inner,recursive,default_sort"`
|
||||
}
|
||||
|
||||
type tableTest4 struct {
|
||||
Inline tableTest2 `table:"ignored,recursive_inline"`
|
||||
SortField string `table:"sort_field,default_sort"`
|
||||
}
|
||||
|
||||
func Test_DisplayTable(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -188,6 +193,31 @@ foo foo1 foo3 2022-08-02T15:49:10Z
|
||||
compareTables(t, expected, out)
|
||||
})
|
||||
|
||||
t.Run("Inline", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
expected := `
|
||||
NAME AGE
|
||||
Alice 25
|
||||
`
|
||||
|
||||
inlineIn := []tableTest4{
|
||||
{
|
||||
Inline: tableTest2{
|
||||
Name: stringWrapper{
|
||||
str: "Alice",
|
||||
},
|
||||
Age: 25,
|
||||
NotIncluded: "IgnoreMe",
|
||||
},
|
||||
},
|
||||
}
|
||||
out, err := cliui.DisplayTable(inlineIn, "", []string{"name", "age"})
|
||||
log.Println("rendered table:\n" + out)
|
||||
require.NoError(t, err)
|
||||
compareTables(t, expected, out)
|
||||
})
|
||||
|
||||
// This test ensures that safeties against invalid use of `table` tags
|
||||
// causes errors (even without data).
|
||||
t.Run("Errors", func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user