@@ -570,13 +570,18 @@ it("removes user from team on the client", async ({ expect }) => {
570570 } ) ;
571571 expect ( response1 ) . toMatchInlineSnapshot ( `
572572 NiceResponse {
573- "status": 400 ,
573+ "status": 401 ,
574574 "body": {
575- "code": "CANNOT_GET_OWN_USER_WITHOUT_USER",
576- "error": "You have specified 'me' as a userId, but did not provide authentication for a user.",
575+ "code": "TEAM_PERMISSION_REQUIRED",
576+ "details": {
577+ "permission_id": "$remove_members",
578+ "team_id": "<stripped UUID>",
579+ "user_id": "<stripped UUID>",
580+ },
581+ "error": "User <stripped UUID> does not have permission $remove_members in team <stripped UUID>.",
577582 },
578583 "headers": Headers {
579- "x-stack-known-error": "CANNOT_GET_OWN_USER_WITHOUT_USER ",
584+ "x-stack-known-error": "TEAM_PERMISSION_REQUIRED ",
580585 <some fields may have been hidden>,
581586 },
582587 }
@@ -596,15 +601,9 @@ it("removes user from team on the client", async ({ expect }) => {
596601 } ) ;
597602 expect ( response2 ) . toMatchInlineSnapshot ( `
598603 NiceResponse {
599- "status": 400,
600- "body": {
601- "code": "CANNOT_GET_OWN_USER_WITHOUT_USER",
602- "error": "You have specified 'me' as a userId, but did not provide authentication for a user.",
603- },
604- "headers": Headers {
605- "x-stack-known-error": "CANNOT_GET_OWN_USER_WITHOUT_USER",
606- <some fields may have been hidden>,
607- },
604+ "status": 200,
605+ "body": { "success": true },
606+ "headers": Headers { <some fields may have been hidden> },
608607 }
609608 ` ) ;
610609} ) ;
@@ -624,15 +623,17 @@ it("creates a team on the server and adds a different user as the creator", asyn
624623 } ) ;
625624 expect ( response ) . toMatchInlineSnapshot ( `
626625 NiceResponse {
627- "status": 404 ,
626+ "status": 201 ,
628627 "body": {
629- "code": "USER_NOT_FOUND",
630- "error": "User not found.",
631- },
632- "headers": Headers {
633- "x-stack-known-error": "USER_NOT_FOUND",
634- <some fields may have been hidden>,
628+ "client_metadata": null,
629+ "client_read_only_metadata": null,
630+ "created_at_millis": <stripped field 'created_at_millis'>,
631+ "display_name": "My Team",
632+ "id": "<stripped UUID>",
633+ "profile_image_url": null,
634+ "server_metadata": null,
635635 },
636+ "headers": Headers { <some fields may have been hidden> },
636637 }
637638 ` ) ;
638639
@@ -644,19 +645,20 @@ it("creates a team on the server and adds a different user as the creator", asyn
644645 } ) ;
645646 expect ( response2 ) . toMatchInlineSnapshot ( `
646647 NiceResponse {
647- "status": 401 ,
648+ "status": 200 ,
648649 "body": {
649- "code ": "INVALID_PROJECT_FOR_ACCESS_TOKEN" ,
650- "details ": {
651- "actual_project_id": "<stripped UUID>",
652- "expected_project_id ": "internal" ,
653- } ,
654- "error": "Access token not valid for this project. Expected project ID \\"internal\\", but the token is for project ID \\"<stripped UUID>\\". ",
655- } ,
656- "headers ": Headers {
657- "x-stack-known-error": "INVALID_PROJECT_FOR_ACCESS_TOKEN" ,
658- <some fields may have been hidden> ,
650+ "is_paginated ": false ,
651+ "items ": [
652+ {
653+ "client_metadata ": null ,
654+ "client_read_only_metadata": null ,
655+ "display_name": "My Team ",
656+ "id": "<stripped UUID>" ,
657+ "profile_image_url ": null,
658+ } ,
659+ ] ,
659660 },
661+ "headers": Headers { <some fields may have been hidden> },
660662 }
661663 ` ) ;
662664} ) ;
0 commit comments