Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gao-sun committed May 16, 2024
1 parent afccaee commit 5cb1e09
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/core/jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/queries/roles.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
`;
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/routes/role.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const roles = {
findRoleByRoleName: jest.fn(async (): Promise<Role | null> => null),
insertRole: jest.fn(async (data) => ({
type: mockAdminUserRole.type,
isDefault: false,
...data,
id: mockAdminUserRole.id,
tenantId: 'fake_tenant',
Expand Down

0 comments on commit 5cb1e09

Please sign in to comment.