mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: Allow spaces in searches (#2723)
This commit is contained in:
@@ -33,6 +33,15 @@ func TestSearchUsers(t *testing.T) {
|
||||
RbacRole: []string{},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "UsernameWithSpaces",
|
||||
Query: " user-name ",
|
||||
Expected: database.GetUsersParams{
|
||||
Search: "user-name",
|
||||
Status: []database.UserStatus{},
|
||||
RbacRole: []string{},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "Username+Param",
|
||||
Query: "usEr-name stAtus:actiVe",
|
||||
|
||||
@@ -31,6 +31,14 @@ func TestSearchWorkspace(t *testing.T) {
|
||||
Name: "bar",
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "Owner/NameWithSpaces",
|
||||
Query: " Foo/Bar ",
|
||||
Expected: database.GetWorkspacesParams{
|
||||
OwnerUsername: "foo",
|
||||
Name: "bar",
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "Name",
|
||||
Query: "workspace-name",
|
||||
|
||||
Reference in New Issue
Block a user