Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export function buildFoundCompanyFullInfoDs(
id: group.id,
isMain: group.isMain,
title: group.title,
cedarPolicy: group.cedarPolicy,
users: group.users.map((user) => buildSimpleUserInfoDs(user)).filter((user) => !!user),
};
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export class FoundGroupInConnectionDTO {
@ApiProperty()
isMain: boolean;

@ApiProperty()
cedarPolicy: string | null;

@ApiProperty({ required: false, isArray: true, type: SimpleFoundUserInfoDs })
users?: Array<SimpleFoundUserInfoDs>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export function buildFoundUserGroupInConnectionDto(
id: group.id,
title: group.title,
isMain: group.isMain,
cedarPolicy: group.cedarPolicy,
users: group.users?.length ? group.users.map((user) => buildSimpleUserInfoDs(user)) : undefined,
},
accessLevel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export class FoundGroupDataInfoDs {

@ApiProperty()
isMain: boolean;

@ApiProperty()
cedarPolicy: string | null;
}

export class FoundGroupDataWithUsersDs extends FoundGroupDataInfoDs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ export class FindAllUserGroupsUseCase extends AbstractUseCase<string, FoundUserG
groups: groupsWithAccessLevels.map((g) => {
const {
accessLevel,
group: { id, isMain, title },
group: { id, isMain, title, cedarPolicy },
} = g;
return {
group: {
id: id,
title: title,
isMain: isMain,
cedarPolicy: cedarPolicy,
},
accessLevel: accessLevel,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export class UpdateGroupTitleUseCase
id: updatedGroup.id,
title: updatedGroup.title,
isMain: updatedGroup.isMain,
cedarPolicy: updatedGroup.cedarPolicy,
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,11 @@ test.serial(`${currentTest} should return full found company info for company ad
t.is(Object.hasOwn(foundCompanyInfoRO.connections[0], 'author'), true);
t.is(Object.hasOwn(foundCompanyInfoRO.connections[0], 'groups'), true);
t.is(foundCompanyInfoRO.connections[0].groups.length > 0, true);
t.is(Object.keys(foundCompanyInfoRO.connections[0].groups[0]).length, 4);
t.is(Object.keys(foundCompanyInfoRO.connections[0].groups[0]).length, 5);
t.is(Object.hasOwn(foundCompanyInfoRO.connections[0].groups[0], 'id'), true);
t.is(Object.hasOwn(foundCompanyInfoRO.connections[0].groups[0], 'title'), true);
t.is(Object.hasOwn(foundCompanyInfoRO.connections[0].groups[0], 'isMain'), true);
t.is(Object.hasOwn(foundCompanyInfoRO.connections[0].groups[0], 'cedarPolicy'), true);
t.is(Object.hasOwn(foundCompanyInfoRO.connections[0].groups[0], 'users'), true);
t.is(foundCompanyInfoRO.connections[0].groups[0].users.length > 0, true);
t.is(Object.keys(foundCompanyInfoRO.connections[0].groups[0].users[0]).length, 9);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,7 @@ test.serial(`${currentTest} should return connection without deleted group resul
const _groupId = result[0].group.id;

t.is(Object.hasOwn(result[0].group, 'title'), true);
t.is(Object.hasOwn(result[0].group, 'cedarPolicy'), true);
t.is(result[0].accessLevel, AccessLevelEnum.edit);

const index = result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ test.serial(`${currentTest} should return all user groups`, async (t) => {

t.is(Object.hasOwn(result[1].group, 'users'), true);
t.is(Object.hasOwn(result[0].group, 'title'), true);
t.is(Object.hasOwn(result[0].group, 'cedarPolicy'), true);
t.is(Object.hasOwn(result[0].group, 'connection'), false);
t.is(result[1].accessLevel, AccessLevelEnum.edit);
} catch (e) {
Expand Down Expand Up @@ -636,6 +637,7 @@ test.serial(`${currentTest} should return an delete result`, async (t) => {
t.is(result.length, 1);

t.is(result[0].group.title, 'Admin');
t.is(Object.hasOwn(result[0].group, 'cedarPolicy'), true);
t.is(result[0].accessLevel, AccessLevelEnum.edit);

const index = result
Expand Down
3 changes: 2 additions & 1 deletion backend/test/ava-tests/saas-tests/company-info-e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,11 @@ test.serial(`${currentTest} should return full found company info for company ad
t.is(Object.hasOwn(foundCompanyInfoRO.connections[0], 'author'), true);
t.is(Object.hasOwn(foundCompanyInfoRO.connections[0], 'groups'), true);
t.is(foundCompanyInfoRO.connections[0].groups.length > 0, true);
t.is(Object.keys(foundCompanyInfoRO.connections[0].groups[0]).length, 4);
t.is(Object.keys(foundCompanyInfoRO.connections[0].groups[0]).length, 5);
t.is(Object.hasOwn(foundCompanyInfoRO.connections[0].groups[0], 'id'), true);
t.is(Object.hasOwn(foundCompanyInfoRO.connections[0].groups[0], 'title'), true);
t.is(Object.hasOwn(foundCompanyInfoRO.connections[0].groups[0], 'isMain'), true);
t.is(Object.hasOwn(foundCompanyInfoRO.connections[0].groups[0], 'cedarPolicy'), true);
t.is(Object.hasOwn(foundCompanyInfoRO.connections[0].groups[0], 'users'), true);
t.is(foundCompanyInfoRO.connections[0].groups[0].users.length > 0, true);
t.is(Object.keys(foundCompanyInfoRO.connections[0].groups[0].users[0]).length, 9);
Expand Down
1 change: 1 addition & 0 deletions backend/test/ava-tests/saas-tests/connection-e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,7 @@ test.serial(`${currentTest} should return connection without deleted group resul
const _groupId = result[0].group.id;

t.is(Object.hasOwn(result[0].group, 'title'), true);
t.is(Object.hasOwn(result[0].group, 'cedarPolicy'), true);
t.is(result[0].accessLevel, AccessLevelEnum.edit);

const index = result
Expand Down
2 changes: 2 additions & 0 deletions backend/test/ava-tests/saas-tests/group-e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ test.serial(`${currentTest} should return all user groups`, async (t) => {
t.is(Object.hasOwn(result[1].group, 'users'), true);
t.is(Object.hasOwn(result[1].group.users[0], 'password'), false);
t.is(Object.hasOwn(result[0].group, 'title'), true);
t.is(Object.hasOwn(result[0].group, 'cedarPolicy'), true);
t.is(Object.hasOwn(result[0].group, 'connection'), false);
t.is(result[1].accessLevel, AccessLevelEnum.edit);
} catch (e) {
Expand Down Expand Up @@ -624,6 +625,7 @@ test.serial(`${currentTest} should return an delete result`, async (t) => {
t.is(result.length, 1);

t.is(result[0].group.title, 'Admin');
t.is(Object.hasOwn(result[0].group, 'cedarPolicy'), true);
t.is(result[0].accessLevel, AccessLevelEnum.edit);

const index = result
Expand Down
Loading