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

Function TestGetUsersPagination

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

Source from the content-addressed store, hash-verified

1813}
1814
1815func TestGetUsersPagination(t *testing.T) {
1816 t.Parallel()
1817 client := coderdtest.New(t, nil)
1818 _ = coderdtest.CreateFirstUser(t, client)
1819
1820 ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
1821 defer cancel()
1822
1823 coderdtest.UsersPagination(ctx, t, client, nil, func(req codersdk.UsersRequest) ([]codersdk.ReducedUser, int) {
1824 res, err := client.Users(ctx, req)
1825 require.NoError(t, err)
1826 reduced := make([]codersdk.ReducedUser, len(res.Users))
1827 for i, user := range res.Users {
1828 reduced[i] = user.ReducedUser
1829 }
1830 return reduced, res.Count
1831 })
1832}
1833
1834func TestPostTokens(t *testing.T) {
1835 t.Parallel()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.92
CreateFirstUserFunction · 0.92
UsersPaginationFunction · 0.92
UsersMethod · 0.65

Tested by

no test coverage detected