diff --git a/packages/core/jest.setup.js b/packages/core/jest.setup.js index a38acc38c84..dd90ab88585 100644 --- a/packages/core/jest.setup.js +++ b/packages/core/jest.setup.js @@ -18,8 +18,8 @@ mockEsm('#src/libraries/logto-config.js', () => ({ createLogtoConfigLibrary: () => ({ getOidcConfigs: () => ({}) }), })); -mockEsm('#src/env-set/check-alteration-state.js', () => ({ - checkAlterationState: () => true, +mockEsm('#src/env-set/preconditions.js', () => ({ + checkPreconditions: () => true, })); // eslint-disable-next-line unicorn/consistent-function-scoping diff --git a/packages/core/src/queries/roles.test.ts b/packages/core/src/queries/roles.test.ts index 86e66de4316..4ddf8238272 100644 --- a/packages/core/src/queries/roles.test.ts +++ b/packages/core/src/queries/roles.test.ts @@ -135,7 +135,7 @@ describe('roles query', () => { const keys = excludeAutoSetFields(Roles.fieldKeys); const expectSql = ` - insert into "roles" ("id", "name", "description", "type") + insert into "roles" ("id", "name", "description", "type", "is_default") values (${keys.map((_, index) => `$${index + 1}`).join(', ')}) returning * `; diff --git a/packages/core/src/routes/role.test.ts b/packages/core/src/routes/role.test.ts index 933e6b77f0f..1b79812e3bc 100644 --- a/packages/core/src/routes/role.test.ts +++ b/packages/core/src/routes/role.test.ts @@ -18,6 +18,7 @@ const roles = { findRoleByRoleName: jest.fn(async (): Promise => null), insertRole: jest.fn(async (data) => ({ type: mockAdminUserRole.type, + isDefault: false, ...data, id: mockAdminUserRole.id, tenantId: 'fake_tenant',