From f953289f750bc58d3b540d5591a9cb0c49eb3231 Mon Sep 17 00:00:00 2001 From: wangsijie Date: Wed, 17 May 2023 15:19:12 +0800 Subject: [PATCH] test: remove tests with defaultManagementApi.role.id (#3855) --- .../src/tests/api/admin-user.roles.test.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/integration-tests/src/tests/api/admin-user.roles.test.ts b/packages/integration-tests/src/tests/api/admin-user.roles.test.ts index c9c075291..3455b7d48 100644 --- a/packages/integration-tests/src/tests/api/admin-user.roles.test.ts +++ b/packages/integration-tests/src/tests/api/admin-user.roles.test.ts @@ -1,4 +1,3 @@ -import { defaultManagementApi } from '@logto/schemas'; import { HTTPError } from 'got'; import { assignRolesToUser, getUserRoles, deleteRoleFromUser } from '#src/api/index.js'; @@ -35,9 +34,10 @@ describe('admin console user management (roles)', () => { it('should delete role from user successfully', async () => { const user = await createUserByAdmin(); + const role = await createRole(); - await assignRolesToUser(user.id, [defaultManagementApi.role.id]); - await deleteRoleFromUser(user.id, defaultManagementApi.role.id); + await assignRolesToUser(user.id, [role.id]); + await deleteRoleFromUser(user.id, role.id); const roles = await getUserRoles(user.id); expect(roles.length).toBe(0); @@ -45,10 +45,9 @@ describe('admin console user management (roles)', () => { it('should delete non-exist-role from user failed', async () => { const user = await createUserByAdmin(); + const role = await createRole(); - const response = await deleteRoleFromUser(user.id, defaultManagementApi.role.id).catch( - (error: unknown) => error - ); + const response = await deleteRoleFromUser(user.id, role.id).catch((error: unknown) => error); expect(response instanceof HTTPError && response.response.statusCode === 404).toBe(true); }); });