diff --git a/apps/policy-engine/src/open-policy-agent/core/__test__/unit/open-policy-agent.engine.spec.ts b/apps/policy-engine/src/open-policy-agent/core/__test__/unit/open-policy-agent.engine.spec.ts index c47fe6848..c367519d5 100644 --- a/apps/policy-engine/src/open-policy-agent/core/__test__/unit/open-policy-agent.engine.spec.ts +++ b/apps/policy-engine/src/open-policy-agent/core/__test__/unit/open-policy-agent.engine.spec.ts @@ -73,11 +73,10 @@ describe('OpenPolicyAgentEngine', () => { credentials: [], tokens: [], userGroupMembers: [], - userGroups: [], + groups: [], userAccounts: [], users: [], accountGroupMembers: [], - accountGroups: [], accounts: [] }) }) @@ -440,7 +439,7 @@ describe('OpenPolicyAgentEngine', () => { ], tokens: [], userGroupMembers: [], - userGroups: [], + groups: [], userAccounts: [], users: [ { @@ -449,7 +448,6 @@ describe('OpenPolicyAgentEngine', () => { } ], accountGroupMembers: [], - accountGroups: [], accounts: [ { id: 'eip155:eoa:0x0301e2724a40E934Cce3345928b88956901aA127', diff --git a/packages/policy-engine-shared/src/lib/util/__test__/unit/entity.util.spec.ts b/packages/policy-engine-shared/src/lib/util/__test__/unit/entity.util.spec.ts index 2a64e72f6..4d0c7b7ab 100644 --- a/packages/policy-engine-shared/src/lib/util/__test__/unit/entity.util.spec.ts +++ b/packages/policy-engine-shared/src/lib/util/__test__/unit/entity.util.spec.ts @@ -1,4 +1,4 @@ -import { ACCOUNT, ACCOUNT_GROUP, ADDRESS_BOOK, CREDENTIAL, TOKEN, USER, USER_GROUP } from '../../../dev.fixture' +import { ACCOUNT, ADDRESS_BOOK, CREDENTIAL, GROUP, TOKEN, USER } from '../../../dev.fixture' import { Entities, UserEntity, UserRole } from '../../../type/entity.type' import { empty, updateUserAccounts, validate } from '../../entity.util' @@ -8,11 +8,10 @@ describe('validate', () => { credentials: [], tokens: [], userGroupMembers: [], - userGroups: [], userAccounts: [], users: [], accountGroupMembers: [], - accountGroups: [], + groups: [], accounts: [] } @@ -22,7 +21,7 @@ describe('validate', () => { ...emptyEntities, userGroupMembers: [ { - groupId: USER_GROUP.Engineering.id, + groupId: GROUP.Engineering.id, userId: USER.Alice.id } ], @@ -44,10 +43,10 @@ describe('validate', () => { it('fails when user from user group member does not exist', () => { const result = validate({ ...emptyEntities, - userGroups: [USER_GROUP.Engineering], + groups: [GROUP.Engineering], userGroupMembers: [ { - groupId: USER_GROUP.Engineering.id, + groupId: GROUP.Engineering.id, userId: USER.Alice.id } ] @@ -72,7 +71,7 @@ describe('validate', () => { accountGroupMembers: [ { accountId: ACCOUNT.Engineering.id, - groupId: ACCOUNT_GROUP.Engineering.id + groupId: GROUP.Engineering.id } ] }) @@ -92,11 +91,11 @@ describe('validate', () => { it('fails when account from account group member does not exist', () => { const result = validate({ ...emptyEntities, - accountGroups: [ACCOUNT_GROUP.Engineering], + groups: [GROUP.Engineering], accountGroupMembers: [ { accountId: ACCOUNT.Engineering.id, - groupId: ACCOUNT_GROUP.Engineering.id + groupId: GROUP.Engineering.id } ] }) @@ -215,7 +214,7 @@ describe('validate', () => { it('fails when user group uids are not unique', () => { const result = validate({ ...emptyEntities, - userGroups: [USER_GROUP.Engineering, USER_GROUP.Engineering, USER_GROUP.Treasury] + groups: [GROUP.Engineering, GROUP.Engineering, GROUP.Treasury] }) expect(result).toEqual({ @@ -223,7 +222,7 @@ describe('validate', () => { issues: [ { code: 'UNIQUE_IDENTIFIER_DUPLICATION', - message: `the user group ${USER_GROUP.Engineering.id} is duplicated` + message: `the user group ${GROUP.Engineering.id} is duplicated` } ] }) @@ -249,7 +248,7 @@ describe('validate', () => { it('fails when account group uids are not unique', () => { const result = validate({ ...emptyEntities, - accountGroups: [ACCOUNT_GROUP.Engineering, ACCOUNT_GROUP.Engineering, ACCOUNT_GROUP.Treasury] + groups: [GROUP.Engineering, GROUP.Engineering, GROUP.Treasury] }) expect(result).toEqual({ @@ -257,7 +256,7 @@ describe('validate', () => { issues: [ { code: 'UNIQUE_IDENTIFIER_DUPLICATION', - message: `the account group ${ACCOUNT_GROUP.Engineering.id} is duplicated` + message: `the account group ${GROUP.Engineering.id} is duplicated` } ] })