Skip to content

Commit

Permalink
fix: update lieux mediation numerique dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-gavanier committed Jun 29, 2023
1 parent e91bba8 commit 0c4e841
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"ts-node": "^10.9.1"
},
"dependencies": {
"@gouvfr-anct/lieux-de-mediation-numerique": "^1.15.0",
"@gouvfr-anct/lieux-de-mediation-numerique": "^1.17.0",
"@gouvfr-anct/timetable-to-osm-opening-hours": "^1.0.1",
"axios": "^1.2.2",
"commander": "^10.0.0",
Expand Down
59 changes: 57 additions & 2 deletions src/data-inclusion/merge-services-in-structure.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('merge services in structure', (): void => {
telephone: '+33180059880',
site_web: 'https://www.laquincaillerie.tl/;https://m.facebook.com/laquincaillerienumerique/',
horaires_ouverture: 'Mo-Fr 09:00-12:00,14:00-18:30; Sa 08:30-12:00',
labels_nationaux: ['france-service', 'aptic'],
labels_nationaux: ['france-service', 'aptic', 'conseiller-numerique'],
labels_autres: ['SudLabs', 'Nièvre médiation numérique'],
latitude: 43.52609,
longitude: 5.41423,
Expand Down Expand Up @@ -146,7 +146,7 @@ describe('merge services in structure', (): void => {
horaires: 'Mo-Fr 09:00-12:00,14:00-18:30; Sa 08:30-12:00',
accessibilite:
'https://acceslibre.beta.gouv.fr/app/29-lampaul-plouarzel/a/bibliotheque-mediatheque/erp/mediatheque-13/',
labels_nationaux: 'france-service,aptic',
labels_nationaux: 'france-service,aptic,conseiller-numerique',
labels_autres: 'SudLabs,Nièvre médiation numérique',
typologie: Typologie.TIERS_LIEUX,
frais: 'gratuit-sous-conditions',
Expand Down Expand Up @@ -400,4 +400,59 @@ describe('merge services in structure', (): void => {
}
]);
});

it('should keep labels and contact info when merge a service with address', (): void => {
const structure: SchemaStructureDataInclusion = {
adresse: '51 rue de la république',
code_postal: '75013',
commune: 'Paris',
date_maj: '2022-11-07',
id: 'structure-1',
nom: 'Médiation république',
presentation_resume: 'Médiation république aides tous type de publics en difficulté avec le numérique',
presentation_detail: 'De nombreux Français ont du mal à utiliser le numérique dans leur quotidien...',
siret: '43493312300029',
source: 'cnfs',
labels_nationaux: ['france-service', 'aptic', 'conseiller-numerique'],
labels_autres: ['hinaura'],
telephone: '+33647892366',
courriel: 'contact@medrep.fr',
site_web: 'https://medrep.fr'
};

const service: Partial<SchemaStructureDataInclusionAdresseFields> & SchemaServiceDataInclusion = {
id: 'structure-1-mediation-numerique',
nom: 'Médiation numérique',
source: 'cnfs',
structure_id: 'structure-1',
thematiques: ['numerique--devenir-autonome-dans-les-demarches-administratives'],
adresse: '51 rue de la république',
code_postal: '75013',
commune: 'Paris'
};

const dataInclusionMerged: DataInclusionMerged[] = structuresWithServicesNumeriques([structure], [service]);

expect(dataInclusionMerged).toStrictEqual<DataInclusionMerged[]>([
{
code_postal: '75013',
commune: 'Paris',
adresse: '51 rue de la république',
date_maj: '2022-11-07T00:00:00.000Z',
id: 'cnfs-structure-1-mediation-numerique',
structure_parente: 'structure-1',
nom: 'Médiation république',
pivot: '43493312300029',
thematiques: 'numerique--devenir-autonome-dans-les-demarches-administratives',
source: 'cnfs',
labels_nationaux: 'france-service,aptic,conseiller-numerique',
labels_autres: 'hinaura',
telephone: '+33647892366',
courriel: 'contact@medrep.fr',
site_web: 'https://medrep.fr',
presentation_resume: 'Médiation république aides tous type de publics en difficulté avec le numérique',
presentation_detail: 'De nombreux Français ont du mal à utiliser le numérique dans leur quotidien...'
}
]);
});
});
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,10 @@
minimatch "^3.1.2"
strip-json-comments "^3.1.1"

"@gouvfr-anct/lieux-de-mediation-numerique@^1.15.0":
version "1.15.0"
resolved "https://registry.yarnpkg.com/@gouvfr-anct/lieux-de-mediation-numerique/-/lieux-de-mediation-numerique-1.15.0.tgz#71f521791394ad87d413b9ba62141969ea92df3f"
integrity sha512-BfWtCCSCtVODklQUU74ae6ynsJn9XRw2PeuYY/3jfb+9BYLMe9B5CjdImVGuZ7sAyFkZuT+ReVLpWdcs45Rb1Q==
"@gouvfr-anct/lieux-de-mediation-numerique@^1.17.0":
version "1.17.0"
resolved "https://registry.yarnpkg.com/@gouvfr-anct/lieux-de-mediation-numerique/-/lieux-de-mediation-numerique-1.17.0.tgz#37bc3f1ad36d3d8cfeaaea585271ace8b4544b0c"
integrity sha512-FU6Qdle/Pm0WEI01HDlsF9p82l3iZa4oBYOgKsnIo6xcHjXeTEn09nnKMpobohpzyffJO5XgYV90s4Fc0ujctQ==

"@gouvfr-anct/timetable-to-osm-opening-hours@^1.0.1":
version "1.1.0"
Expand Down

0 comments on commit 0c4e841

Please sign in to comment.