-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add tests for organisations with matching group
check if record collect the right logo/thumbnail
- Loading branch information
Showing
3 changed files
with
62 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,14 @@ const sampleOrgB: Organisation = { | |
recordCount: 1, | ||
description: null, | ||
} | ||
const sampleOrgC: Organisation = { | ||
emails: ['[email protected]'], | ||
email: '[email protected]', | ||
logoUrl: '/geonetwork/images/harvesting/ifremer.png', | ||
name: 'Ifremer', | ||
recordCount: 1, | ||
description: null, | ||
} | ||
|
||
const organisationsAggregationMock = { | ||
aggregations: { | ||
|
@@ -67,6 +75,20 @@ const organisationsAggregationMock = { | |
], | ||
}, | ||
}, | ||
{ | ||
key: 'Ifremer', | ||
doc_count: 1, | ||
mail: { | ||
doc_count_error_upper_bound: 0, | ||
sum_other_doc_count: 0, | ||
buckets: [ | ||
{ | ||
key: '[email protected]', | ||
doc_count: 1, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
|
@@ -181,6 +203,13 @@ describe('OrganisationsFromMetadataService', () => { | |
name: 'BAKOM', | ||
recordCount: 1, | ||
}, | ||
{ | ||
description: null, | ||
emails: ['[email protected]'], | ||
logoUrl: null, | ||
name: 'Ifremer', | ||
recordCount: 1, | ||
}, | ||
]) | ||
}) | ||
}) | ||
|
@@ -192,7 +221,7 @@ describe('OrganisationsFromMetadataService', () => { | |
.subscribe((orgs) => (organisations = orgs)) | ||
}) | ||
it('get organisations hydrated from groups via name or email mapping', () => { | ||
expect(organisations).toEqual([sampleOrgA, sampleOrgB]) | ||
expect(organisations).toEqual([sampleOrgA, sampleOrgB, sampleOrgC]) | ||
}) | ||
}) | ||
}) | ||
|
@@ -245,12 +274,12 @@ describe('OrganisationsFromMetadataService', () => { | |
let filters | ||
beforeEach(async () => { | ||
filters = await firstValueFrom( | ||
service.getFiltersForOrgs([sampleOrgA, sampleOrgB]) | ||
service.getFiltersForOrgs([sampleOrgA, sampleOrgB, sampleOrgC]) | ||
) | ||
}) | ||
it('generates filters', () => { | ||
expect(filters).toEqual({ | ||
OrgForResource: { ARE: true, BAKOM: true }, | ||
OrgForResource: { ARE: true, BAKOM: true, Ifremer: true }, | ||
}) | ||
}) | ||
}) | ||
|
@@ -288,14 +317,18 @@ describe('OrganisationsFromMetadataService', () => { | |
title: 'Surval - Données par paramètre', | ||
uuid: 'cf5048f6-5bbf-4e44-ba74-e6f429af51ea', | ||
contact: { | ||
name: "Cellule d'administration Quadrige", | ||
organisation: 'Ifremer', | ||
email: '[email protected]', | ||
website: 'https://www.ifremer.fr/', | ||
logoUrl: | ||
'http://localhost/geonetwork/images/logos/81e8a591-7815-4d2f-a7da-5673192e74c9.png', | ||
name: 'Ifremer', | ||
email: '[email protected]', | ||
logoUrl: 'http://localhost/geonetwork/images/harvesting/ifremer.png', | ||
}, | ||
resourceContacts: [ | ||
{ | ||
email: '[email protected]', | ||
logoUrl: | ||
'http://localhost/geonetwork/images/harvesting/ifremer.png', | ||
name: 'Ifremer', | ||
organisation: 'Ifremer', | ||
}, | ||
{ | ||
email: '[email protected]', | ||
logoUrl: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,4 +58,23 @@ export const GROUPS_FIXTURE = deepFreeze([ | |
eng: 'Municipality of Köniz', | ||
}, | ||
}, | ||
{ | ||
logo: 'ifremer.png', | ||
website: 'www.ifremer.ch', | ||
defaultCategory: null, | ||
allowedCategories: [], | ||
enableAllowedCategories: false, | ||
id: 348385324, | ||
email: '[email protected]', | ||
referrer: null, | ||
description: '', | ||
name: 'Ifremer', | ||
label: { | ||
ger: 'Ifremer', | ||
ita: 'Ifremer', | ||
fre: 'Ifremer', | ||
roh: 'Ifremer', | ||
eng: 'Ifremer', | ||
}, | ||
}, | ||
]) |