Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c7b80ee

Browse files
committed
chore: add test cases for shared filter
1 parent 060560d commit c7b80ee

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

coderd/searchquery/search_test.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,36 @@ func TestSearchWorkspace(t *testing.T) {
282282
},
283283
},
284284
},
285+
{
286+
Name: "SharedTrue",
287+
Query: "",
288+
Expected: database.GetWorkspacesParams{
289+
Shared: sql.NullBool{
290+
Bool: true,
291+
Valid: true,
292+
},
293+
},
294+
},
295+
{
296+
Name: "SharedFalse",
297+
Query: "",
298+
Expected: database.GetWorkspacesParams{
299+
Shared: sql.NullBool{
300+
Bool: false,
301+
Valid: true,
302+
},
303+
},
304+
},
305+
{
306+
Name: "SharedMissing",
307+
Query: "",
308+
Expected: database.GetWorkspacesParams{
309+
Shared: sql.NullBool{
310+
Bool: false,
311+
Valid: false,
312+
},
313+
},
314+
},
285315

286316
// Failures
287317
{

0 commit comments

Comments
 (0)