MCPcopy Index your code
hub / github.com/coder/coder / TestGetUsersFilter

Function TestGetUsersFilter

coderd/users_test.go:1790–1813  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1788}
1789
1790func TestGetUsersFilter(t *testing.T) {
1791 t.Parallel()
1792
1793 client, _, api := coderdtest.NewWithAPI(t, &coderdtest.Options{
1794 IncludeProvisionerDaemon: true,
1795 OIDCConfig: &coderd.OIDCConfig{
1796 AllowSignups: true,
1797 },
1798 })
1799 _ = coderdtest.CreateFirstUser(t, client)
1800
1801 setupCtx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
1802 defer cancel()
1803
1804 coderdtest.UsersFilter(setupCtx, t, client, api.Database, nil, nil, func(testCtx context.Context, req codersdk.UsersRequest) []codersdk.ReducedUser {
1805 res, err := client.Users(testCtx, req)
1806 require.NoError(t, err)
1807 reduced := make([]codersdk.ReducedUser, len(res.Users))
1808 for i, user := range res.Users {
1809 reduced[i] = user.ReducedUser
1810 }
1811 return reduced
1812 })
1813}
1814
1815func TestGetUsersPagination(t *testing.T) {
1816 t.Parallel()

Callers

nothing calls this directly

Calls 4

NewWithAPIFunction · 0.92
CreateFirstUserFunction · 0.92
UsersFilterFunction · 0.92
UsersMethod · 0.65

Tested by

no test coverage detected