mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
added list user tests
This commit is contained in:
parent
430b27d06f
commit
85b33f6497
@ -774,7 +774,53 @@ describe("with server access", () => {
|
||||
`);
|
||||
});
|
||||
|
||||
it.todo("should be able to list users");
|
||||
it("should be able to list users", async ({ expect }) => {
|
||||
await Project.createAndSwitch({ config: { magic_link_enabled: true } });
|
||||
await Auth.Otp.signIn();
|
||||
|
||||
const response = await niceBackendFetch("/api/v1/users", {
|
||||
accessType: "server",
|
||||
});
|
||||
expect(response).toMatchInlineSnapshot(`
|
||||
NiceResponse {
|
||||
"status": 200,
|
||||
"body": {
|
||||
"is_paginated": false,
|
||||
"items": [
|
||||
{
|
||||
"auth_methods": [
|
||||
{
|
||||
"contact_channel": {
|
||||
"email": "<stripped UUID>@stack-generated.example.com",
|
||||
"type": "email",
|
||||
},
|
||||
"type": "otp",
|
||||
},
|
||||
],
|
||||
"auth_with_email": true,
|
||||
"client_metadata": null,
|
||||
"client_read_only_metadata": null,
|
||||
"connected_accounts": [],
|
||||
"display_name": null,
|
||||
"has_password": false,
|
||||
"id": "<stripped UUID>",
|
||||
"last_active_at_millis": <stripped field 'last_active_at_millis'>,
|
||||
"oauth_providers": [],
|
||||
"primary_email": "<stripped UUID>@stack-generated.example.com",
|
||||
"primary_email_verified": true,
|
||||
"profile_image_url": null,
|
||||
"requires_totp_mfa": false,
|
||||
"selected_team": null,
|
||||
"selected_team_id": null,
|
||||
"server_metadata": null,
|
||||
"signed_up_at_millis": <stripped field 'signed_up_at_millis'>,
|
||||
},
|
||||
],
|
||||
},
|
||||
"headers": Headers { <some fields may have been hidden> },
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
||||
it("should be able to read a user", async ({ expect }) => {
|
||||
await Auth.Otp.signIn();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user