Skip to content

Commit

Permalink
feat: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasheartman committed Sep 25, 2024
1 parent d5cb78a commit 846e16f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ test('should return personal dashboard with membered projects', async () => {
type: 'root',
},
],
owners: [],
owners: [
{
ownerType: 'system',
},
],
},
{
name: projectA.name,
Expand All @@ -122,7 +126,15 @@ test('should return personal dashboard with membered projects', async () => {
type: 'project',
},
],
owners: [],
owners: [
{
email: '[email protected]',
imageUrl:
'https://gravatar.com/avatar/a8cc79d8407a64b0d8982df34e3525afd298a479fe68f300651380730dbf23e9?s=42&d=retro&r=g',
name: '[email protected]',
ownerType: 'user',
},
],
},
{
name: projectC.name,
Expand All @@ -134,7 +146,15 @@ test('should return personal dashboard with membered projects', async () => {
type: 'project',
},
],
owners: [],
owners: [
{
email: '[email protected]',
imageUrl:
'https://gravatar.com/avatar/706150f3ef810ea66acb30c6d55f1a7e545338747072609e47df71c7c7ccc6a4?s=42&d=retro&r=g',
name: '[email protected]',
ownerType: 'user',
},
],
},
],
});
Expand Down Expand Up @@ -184,7 +204,11 @@ test('should return projects where users are part of a group', async () => {
type: 'root',
},
],
owners: [],
owners: [
{
ownerType: 'system',
},
],
},
{
name: projectA.name,
Expand All @@ -201,7 +225,19 @@ test('should return projects where users are part of a group', async () => {
type: 'project',
},
],
owners: [],
owners: [
{
email: '[email protected]',
imageUrl:
'https://gravatar.com/avatar/a8cc79d8407a64b0d8982df34e3525afd298a479fe68f300651380730dbf23e9?s=42&d=retro&r=g',
name: '[email protected]',
ownerType: 'user',
},
{
name: 'groupA',
ownerType: 'group',
},
],
},
],
});
Expand Down
5 changes: 4 additions & 1 deletion src/lib/features/project/project-owners-read-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ export class ProjectOwnersReadModel implements IProjectOwnersReadModel {

const data: UserProjectOwner = {
ownerType: 'user',
name: user?.name || user?.username,
name:
user?.name ||
user?.username ||
processSensitiveData(user?.email),
email: processSensitiveData(user?.email),
imageUrl: generateImageUrl(user),
};
Expand Down

0 comments on commit 846e16f

Please sign in to comment.