From dd4fbe785cea2bc2669d1edab4829e6bdaf3d1d3 Mon Sep 17 00:00:00 2001 From: Robin Monnier Date: Fri, 3 Jan 2025 08:49:52 +0100 Subject: [PATCH] refacto: create folders pages, fonctionnalites, recherche --- cypress/e2e/etablissement-scolaire.cy.js | 14 ----- .../{ => fonctionnalites}/data-fetching.cy.js | 0 .../{ => fonctionnalites}/dynamic-pages.cy.js | 0 .../{ => fonctionnalites}/espace-agent.cy.js | 0 .../etat-administratif.cy.js | 0 cypress/e2e/{ => fonctionnalites}/faq.cy.js | 0 .../immatriculation.cy.js | 0 .../non-diffusible.cy.js | 0 .../protected-data.cy.js | 0 cypress/e2e/{ => fonctionnalites}/seo.cy.js | 0 .../service-public.cy.js | 0 .../{ => fonctionnalites}/static-pages.cy.js | 0 .../unite-legale-pagination.cy.js | 0 .../annonces-et-observations.cy.js} | 2 +- .../{ => pages}/conventions-collectives.cy.js | 2 +- cypress/e2e/pages/dirigeants.cy.js | 6 ++ cypress/e2e/pages/documents.cy.js | 22 +++++++ .../donnees-financieres.cy.js} | 2 +- cypress/e2e/pages/elus.cy.js | 10 ++++ .../e2e/pages/etablissement-scolaire.cy.js | 13 +++++ cypress/e2e/pages/fiche-resume.cy.js | 58 +++++++++++++++++++ .../labels-et-certificats.cy.js} | 2 +- .../{ => recherche}/research-advanced.cy.js | 0 .../research-redirections.cy.js | 0 cypress/e2e/{ => recherche}/research.cy.js | 0 cypress/e2e/tva.cy.js | 24 -------- ...carte-professionnelle-travaux-publics.json | 8 +++ cypress/fixtures/conformite-dgfip.json | 10 ++++ cypress/fixtures/conformite-msa.json | 7 +++ cypress/fixtures/conformite-urssaf.json | 16 +++++ cypress/fixtures/mandataires-rcs.json | 31 ++++++++++ .../carte-professionnelle-travaux-publics.ts | 7 +++ cypress/mocks/handlers/conformite.ts | 16 +++++ cypress/mocks/handlers/mandataires-rcs.ts | 6 ++ cypress/mocks/routes.ts | 41 ++++++++++++- cypress/support/commands.ts | 1 - tsconfig.json | 2 +- 37 files changed, 255 insertions(+), 45 deletions(-) delete mode 100644 cypress/e2e/etablissement-scolaire.cy.js rename cypress/e2e/{ => fonctionnalites}/data-fetching.cy.js (100%) rename cypress/e2e/{ => fonctionnalites}/dynamic-pages.cy.js (100%) rename cypress/e2e/{ => fonctionnalites}/espace-agent.cy.js (100%) rename cypress/e2e/{ => fonctionnalites}/etat-administratif.cy.js (100%) rename cypress/e2e/{ => fonctionnalites}/faq.cy.js (100%) rename cypress/e2e/{ => fonctionnalites}/immatriculation.cy.js (100%) rename cypress/e2e/{ => fonctionnalites}/non-diffusible.cy.js (100%) rename cypress/e2e/{ => fonctionnalites}/protected-data.cy.js (100%) rename cypress/e2e/{ => fonctionnalites}/seo.cy.js (100%) rename cypress/e2e/{ => fonctionnalites}/service-public.cy.js (100%) rename cypress/e2e/{ => fonctionnalites}/static-pages.cy.js (100%) rename cypress/e2e/{ => fonctionnalites}/unite-legale-pagination.cy.js (100%) rename cypress/e2e/{annonces.cy.js => pages/annonces-et-observations.cy.js} (96%) rename cypress/e2e/{ => pages}/conventions-collectives.cy.js (89%) create mode 100644 cypress/e2e/pages/dirigeants.cy.js create mode 100644 cypress/e2e/pages/documents.cy.js rename cypress/e2e/{bilans-financiers.cy.js => pages/donnees-financieres.cy.js} (97%) create mode 100644 cypress/e2e/pages/elus.cy.js create mode 100644 cypress/e2e/pages/etablissement-scolaire.cy.js create mode 100644 cypress/e2e/pages/fiche-resume.cy.js rename cypress/e2e/{certifications.cy.js => pages/labels-et-certificats.cy.js} (98%) rename cypress/e2e/{ => recherche}/research-advanced.cy.js (100%) rename cypress/e2e/{ => recherche}/research-redirections.cy.js (100%) rename cypress/e2e/{ => recherche}/research.cy.js (100%) delete mode 100644 cypress/e2e/tva.cy.js create mode 100644 cypress/fixtures/carte-professionnelle-travaux-publics.json create mode 100644 cypress/fixtures/conformite-dgfip.json create mode 100644 cypress/fixtures/conformite-msa.json create mode 100644 cypress/fixtures/conformite-urssaf.json create mode 100644 cypress/fixtures/mandataires-rcs.json create mode 100644 cypress/mocks/handlers/carte-professionnelle-travaux-publics.ts create mode 100644 cypress/mocks/handlers/conformite.ts create mode 100644 cypress/mocks/handlers/mandataires-rcs.ts diff --git a/cypress/e2e/etablissement-scolaire.cy.js b/cypress/e2e/etablissement-scolaire.cy.js deleted file mode 100644 index 3f37408ab..000000000 --- a/cypress/e2e/etablissement-scolaire.cy.js +++ /dev/null @@ -1,14 +0,0 @@ -describe('Établissement scolaire', () => { - it(('Should display service public and Établissement scolaire section'), () => { - cy.visit('/entreprise/198100125'); - cy.contains('Service public') - cy.contains('Établissements scolaires') - }); - it(("Should display info from annuaire de l'éducation nationale"), () => { - cy.visit('/etablissements-scolaires/198100125'); - cy.contains('Annuaire de l’Education Nationale') - cy.contains('N° UAI') - cy.contains('0810012Y') // UAI - }); - -}) diff --git a/cypress/e2e/data-fetching.cy.js b/cypress/e2e/fonctionnalites/data-fetching.cy.js similarity index 100% rename from cypress/e2e/data-fetching.cy.js rename to cypress/e2e/fonctionnalites/data-fetching.cy.js diff --git a/cypress/e2e/dynamic-pages.cy.js b/cypress/e2e/fonctionnalites/dynamic-pages.cy.js similarity index 100% rename from cypress/e2e/dynamic-pages.cy.js rename to cypress/e2e/fonctionnalites/dynamic-pages.cy.js diff --git a/cypress/e2e/espace-agent.cy.js b/cypress/e2e/fonctionnalites/espace-agent.cy.js similarity index 100% rename from cypress/e2e/espace-agent.cy.js rename to cypress/e2e/fonctionnalites/espace-agent.cy.js diff --git a/cypress/e2e/etat-administratif.cy.js b/cypress/e2e/fonctionnalites/etat-administratif.cy.js similarity index 100% rename from cypress/e2e/etat-administratif.cy.js rename to cypress/e2e/fonctionnalites/etat-administratif.cy.js diff --git a/cypress/e2e/faq.cy.js b/cypress/e2e/fonctionnalites/faq.cy.js similarity index 100% rename from cypress/e2e/faq.cy.js rename to cypress/e2e/fonctionnalites/faq.cy.js diff --git a/cypress/e2e/immatriculation.cy.js b/cypress/e2e/fonctionnalites/immatriculation.cy.js similarity index 100% rename from cypress/e2e/immatriculation.cy.js rename to cypress/e2e/fonctionnalites/immatriculation.cy.js diff --git a/cypress/e2e/non-diffusible.cy.js b/cypress/e2e/fonctionnalites/non-diffusible.cy.js similarity index 100% rename from cypress/e2e/non-diffusible.cy.js rename to cypress/e2e/fonctionnalites/non-diffusible.cy.js diff --git a/cypress/e2e/protected-data.cy.js b/cypress/e2e/fonctionnalites/protected-data.cy.js similarity index 100% rename from cypress/e2e/protected-data.cy.js rename to cypress/e2e/fonctionnalites/protected-data.cy.js diff --git a/cypress/e2e/seo.cy.js b/cypress/e2e/fonctionnalites/seo.cy.js similarity index 100% rename from cypress/e2e/seo.cy.js rename to cypress/e2e/fonctionnalites/seo.cy.js diff --git a/cypress/e2e/service-public.cy.js b/cypress/e2e/fonctionnalites/service-public.cy.js similarity index 100% rename from cypress/e2e/service-public.cy.js rename to cypress/e2e/fonctionnalites/service-public.cy.js diff --git a/cypress/e2e/static-pages.cy.js b/cypress/e2e/fonctionnalites/static-pages.cy.js similarity index 100% rename from cypress/e2e/static-pages.cy.js rename to cypress/e2e/fonctionnalites/static-pages.cy.js diff --git a/cypress/e2e/unite-legale-pagination.cy.js b/cypress/e2e/fonctionnalites/unite-legale-pagination.cy.js similarity index 100% rename from cypress/e2e/unite-legale-pagination.cy.js rename to cypress/e2e/fonctionnalites/unite-legale-pagination.cy.js diff --git a/cypress/e2e/annonces.cy.js b/cypress/e2e/pages/annonces-et-observations.cy.js similarity index 96% rename from cypress/e2e/annonces.cy.js rename to cypress/e2e/pages/annonces-et-observations.cy.js index 270c4e792..3919243d9 100644 --- a/cypress/e2e/annonces.cy.js +++ b/cypress/e2e/pages/annonces-et-observations.cy.js @@ -1,6 +1,6 @@ import routes from '#clients/routes'; -describe('Annonces BODACC', () => { +describe('Annonces et observations', () => { beforeEach(() => { cy.intercept('GET', `${routes.bodacc.ods.search}*`, { fixture: '../fixtures/bodacc.json', diff --git a/cypress/e2e/conventions-collectives.cy.js b/cypress/e2e/pages/conventions-collectives.cy.js similarity index 89% rename from cypress/e2e/conventions-collectives.cy.js rename to cypress/e2e/pages/conventions-collectives.cy.js index ed0e1dcfd..1d60ee9e5 100644 --- a/cypress/e2e/conventions-collectives.cy.js +++ b/cypress/e2e/pages/conventions-collectives.cy.js @@ -1,4 +1,4 @@ -describe('Conventions supprimées', () => { +describe('Conventions collectives', () => { it('Should work for valid companies', () => { cy.visit('/divers/356000000'); cy.contains("Convention d'entreprise La Poste - France Télécom"); diff --git a/cypress/e2e/pages/dirigeants.cy.js b/cypress/e2e/pages/dirigeants.cy.js new file mode 100644 index 000000000..da319f292 --- /dev/null +++ b/cypress/e2e/pages/dirigeants.cy.js @@ -0,0 +1,6 @@ +describe('Dirigeants', () => { + it('No dirigeant in partial diffusible (protected)', () => { + cy.visit(`/dirigeants/908595879`); + cy.contains('Données privées').should('have.length', 1); + }); +}); diff --git a/cypress/e2e/pages/documents.cy.js b/cypress/e2e/pages/documents.cy.js new file mode 100644 index 000000000..98eefe131 --- /dev/null +++ b/cypress/e2e/pages/documents.cy.js @@ -0,0 +1,22 @@ +describe('Documents ESSOR ENERGIES (SOLARSUD)', () => { + it('Bouton agent connect sur les données protégées', () => { + cy.visit('/documents/487444697'); + cy.contains('Réservé aux agents publics').should('be.visible'); + cy.contains('button', 'ProConnect').should('be.visible'); + }); + + it('[LOGGED] Should display basic infos', () => { + cy.login(); + cy.visit('/documents/487444697'); + // Conformité + cy.contains('Conformité').should('be.visible'); + cy.contains('DGFiP : conforme').should('be.visible'); + cy.contains('URSSAF : conforme').should('be.visible'); + cy.contains('MSA : conforme').should('be.visible'); + // Carte professionnelle travaux publics + cy.contains('Carte professionnelle travaux publics').should('be.visible'); + cy.contains( + 'Cette entreprise possède une carte professionnelle d’entrepreneur de travaux publics,' + ).should('be.visible'); + }); +}); diff --git a/cypress/e2e/bilans-financiers.cy.js b/cypress/e2e/pages/donnees-financieres.cy.js similarity index 97% rename from cypress/e2e/bilans-financiers.cy.js rename to cypress/e2e/pages/donnees-financieres.cy.js index edb650b4c..89991a68a 100644 --- a/cypress/e2e/bilans-financiers.cy.js +++ b/cypress/e2e/pages/donnees-financieres.cy.js @@ -1,6 +1,6 @@ import routes from '#clients/routes'; -describe('Bilans financiers', () => { +describe('Données financières', () => { it('Should display Données financières section', () => { cy.visit('/entreprise/487444697'); cy.contains('Données financières'); diff --git a/cypress/e2e/pages/elus.cy.js b/cypress/e2e/pages/elus.cy.js new file mode 100644 index 000000000..145d4ed20 --- /dev/null +++ b/cypress/e2e/pages/elus.cy.js @@ -0,0 +1,10 @@ +describe('Élus VILLE DE PARIS', () => { + it('Should display basic infos', () => { + cy.visit(`/entreprise/2175000164`); + cy.contains('Élus').should('be.visible'); + cy.contains( + 'Cette collectivité possède 164 élus enregistrés au Répertoire National des Élus :' + ).should('be.visible'); + cy.contains(' Anne HIDALGO').should('be.visible'); + }); +}); diff --git a/cypress/e2e/pages/etablissement-scolaire.cy.js b/cypress/e2e/pages/etablissement-scolaire.cy.js new file mode 100644 index 000000000..de29f5500 --- /dev/null +++ b/cypress/e2e/pages/etablissement-scolaire.cy.js @@ -0,0 +1,13 @@ +describe('Établissement scolaire', () => { + it('Should display service public and Établissement scolaire section', () => { + cy.visit('/entreprise/198100125'); + cy.contains('Service public'); + cy.contains('Établissements scolaires'); + }); + it("Should display info from annuaire de l'éducation nationale", () => { + cy.visit('/etablissements-scolaires/198100125'); + cy.contains('Annuaire de l’Education Nationale'); + cy.contains('N° UAI'); + cy.contains('0810012Y'); // UAI + }); +}); diff --git a/cypress/e2e/pages/fiche-resume.cy.js b/cypress/e2e/pages/fiche-resume.cy.js new file mode 100644 index 000000000..46facd90e --- /dev/null +++ b/cypress/e2e/pages/fiche-resume.cy.js @@ -0,0 +1,58 @@ +describe('Fiche résumé DANONE', () => { + it('Should display basic infos', () => { + cy.visit(`/entreprise/danone-552032534`); + cy.contains( + "Sa forme juridique est SA à conseil d'administration (s.a.i.)." + ).should('be.visible'); + cy.contains('Informations légales de DANONE').should('be.visible'); + cy.contains( + 'Son siège social est domicilié au 17 BOULEVARD HAUSSMANN 75009 PARIS.' + ).should('be.visible'); + // TVA number + cy.contains('N° TVA Intracommunautaire').should('be.visible'); + cy.contains('FR12 345 678 901').should('be.visible'); + // EORI number + cy.contains('N° EORI').should('be.visible'); + cy.contains('FR 123 456 789 0').should('be.visible'); + // Effectifs + cy.contains('Effectif salarié').should('be.visible'); + cy.contains('1 000 à 1 999 salariés, en 2022').should('be.visible'); + }); + it('[LOGGED] Should display basic infos', () => { + cy.login(); + cy.visit(`/entreprise/danone-552032534`); + // Effectifs + cy.contains('Effectif salarié').should('be.visible'); + cy.contains('1 000 à 1 999 salariés, en 2022').should('be.visible'); + // Résumé pour les agents publics + cy.contains('Résumé pour les agents publics').should('be.visible'); + cy.contains('Documents juridiques').should('be.visible'); + cy.contains('Consulter les Actes et les Statuts constitutifs').should( + 'be.visible' + ); + }); +}); + +describe('Entreprises non-diffusibles', () => { + it('Should be non diffusible', () => { + cy.visit(`/entreprise/300025764`); + cy.contains('ne sont pas publiquement').should('have.length', 1); + }); + + it('Should be diffusible', () => { + cy.visit(`/entreprise/880878145`); + cy.contains('ne sont pas publiquement').should('have.length', 0); + }); +}); + +describe('TVA number special cases', () => { + it('TVA Non-assujettie', () => { + cy.visit(`/entreprise/883010316`).then(() => { + cy.contains('Pas de n° TVA valide'); + }); + cy.visit(`/entreprise/423208180`).then(() => { + cy.contains('Pas de n° TVA valide connu'); + cy.url().should('include', '/definitions/tva-intracommunautaire'); + }); + }); +}); diff --git a/cypress/e2e/certifications.cy.js b/cypress/e2e/pages/labels-et-certificats.cy.js similarity index 98% rename from cypress/e2e/certifications.cy.js rename to cypress/e2e/pages/labels-et-certificats.cy.js index ed9744b9f..b019275d0 100644 --- a/cypress/e2e/certifications.cy.js +++ b/cypress/e2e/pages/labels-et-certificats.cy.js @@ -1,4 +1,4 @@ -describe('Certifications', () => { +describe('Label et certificats', () => { describe('QUALIBAT-RGE', () => { it('Should display QUALIBAT-RGE', () => { cy.visit(`/labels-certificats/843701079`); diff --git a/cypress/e2e/research-advanced.cy.js b/cypress/e2e/recherche/research-advanced.cy.js similarity index 100% rename from cypress/e2e/research-advanced.cy.js rename to cypress/e2e/recherche/research-advanced.cy.js diff --git a/cypress/e2e/research-redirections.cy.js b/cypress/e2e/recherche/research-redirections.cy.js similarity index 100% rename from cypress/e2e/research-redirections.cy.js rename to cypress/e2e/recherche/research-redirections.cy.js diff --git a/cypress/e2e/research.cy.js b/cypress/e2e/recherche/research.cy.js similarity index 100% rename from cypress/e2e/research.cy.js rename to cypress/e2e/recherche/research.cy.js diff --git a/cypress/e2e/tva.cy.js b/cypress/e2e/tva.cy.js deleted file mode 100644 index 60e27fdc2..000000000 --- a/cypress/e2e/tva.cy.js +++ /dev/null @@ -1,24 +0,0 @@ -describe('TVA validation', () => { - it(`should display the TVA number`, () => { - cy.visit(`/entreprise/842019051`); - cy.contains('FR43 842 019 051').should('have.length', 1); - }); - it('TVA Non-assujettie', () => { - cy.visit(`/entreprise/883010316`).then(() => { - cy.contains('n° TVA valide'); - }); - cy.visit(`/entreprise/423208180`).then(() => { - cy.contains('n° TVA valide'); - }); - }); - it('TVA link', () => { - cy.visit(`/entreprise/383657467`).then(() => { - cy.contains('n° TVA valide').click(); - cy.url().should('include', '/definitions/tva-intracommunautaire'); - 0; - }); - cy.visit(`/entreprise/217500016`).then(() => { - cy.contains('FR72 217 500 016').should('have.length', 1); - }); - }); -}); diff --git a/cypress/fixtures/carte-professionnelle-travaux-publics.json b/cypress/fixtures/carte-professionnelle-travaux-publics.json new file mode 100644 index 000000000..faeb362df --- /dev/null +++ b/cypress/fixtures/carte-professionnelle-travaux-publics.json @@ -0,0 +1,8 @@ +{ + "data": { + "document_url": "https://storage.entreprise.api.gouv.fr/siade/1569139162-b99824d9c764aae19a862a0af-carte_professionnelle_fntp.pdf", + "expires_in": 7889238 + }, + "links": {}, + "meta": {} +} diff --git a/cypress/fixtures/conformite-dgfip.json b/cypress/fixtures/conformite-dgfip.json new file mode 100644 index 000000000..fa197986b --- /dev/null +++ b/cypress/fixtures/conformite-dgfip.json @@ -0,0 +1,10 @@ +{ + "data": { + "document_url": "https://storage.entreprise.api.gouv.fr/siade/1569139162-b99824d9c764aae19a862a0af-attestation_fiscale_dgfip.pdf", + "document_url_expires_in": 86400, + "date_delivrance_attestation": "2023-04-11", + "date_periode_analysee": "2023-03-31" + }, + "links": {}, + "meta": {} +} diff --git a/cypress/fixtures/conformite-msa.json b/cypress/fixtures/conformite-msa.json new file mode 100644 index 000000000..791f034b4 --- /dev/null +++ b/cypress/fixtures/conformite-msa.json @@ -0,0 +1,7 @@ +{ + "data": { + "status": "up_to_date" + }, + "links": {}, + "meta": {} +} diff --git a/cypress/fixtures/conformite-urssaf.json b/cypress/fixtures/conformite-urssaf.json new file mode 100644 index 000000000..46e839445 --- /dev/null +++ b/cypress/fixtures/conformite-urssaf.json @@ -0,0 +1,16 @@ +{ + "data": { + "entity_status": { + "code": "ok", + "libelle": "Attestation délivrée par l'Urssaf", + "description": "La délivrance de l'attestation de vigilance a été refusée par l'Urssaf car l'entité n'est pas à jour de ses cotisations sociales." + }, + "date_debut_validite": "2022-12-03", + "date_fin_validite": "2023-06-30", + "code_securite": "GB1QWERTYJJEX1O", + "document_url": "https://storage.entreprise.api.gouv.fr/siade/1569139162-b99824d9c764aae19a862a0af-attestation_vigilance_acoss.pdf", + "document_url_expires_in": 86400 + }, + "links": {}, + "meta": {} +} diff --git a/cypress/fixtures/mandataires-rcs.json b/cypress/fixtures/mandataires-rcs.json new file mode 100644 index 000000000..41e0064f0 --- /dev/null +++ b/cypress/fixtures/mandataires-rcs.json @@ -0,0 +1,31 @@ +{ + "data": [ + { + "data": { + "numero_identification": "784824153", + "type": "personne_morale", + "fonction": "COMMISSAIRE AUX COMPTES SUPPLEANT", + "nom": "Henri", + "prenom": "Martin", + "date_naissance": "1965-01-27", + "date_naissance_timestamp": -155523600, + "lieu_naissance": "ROUBAIX", + "pays_naissance": "FRANCE", + "code_pays_naissance": "FR", + "nationalite": "FRANCAISE", + "code_nationalite": "FR", + "raison_sociale": "BCRH & ASSOCIES - SOCIETE A RESPONSABILITE LIMITEE A ASSOCIE UNIQUE", + "code_greffe": "9201", + "libelle_greffe": "NANTERRE" + }, + "links": {}, + "meta": {} + } + ], + "meta": { + "personnes_physiques_count": 10, + "personnes_morales_count": 2, + "count": 12 + }, + "links": {} +} diff --git a/cypress/mocks/handlers/carte-professionnelle-travaux-publics.ts b/cypress/mocks/handlers/carte-professionnelle-travaux-publics.ts new file mode 100644 index 000000000..8c86547ad --- /dev/null +++ b/cypress/mocks/handlers/carte-professionnelle-travaux-publics.ts @@ -0,0 +1,7 @@ +import { HttpResponse, HttpResponseResolver } from 'msw'; +import carteProfessionnelleTravauxPublics from '../../fixtures/carte-professionnelle-travaux-publics.json'; + +export const carteProfessionnelleTravauxPublicsHandler: HttpResponseResolver = + ({ request }) => { + return HttpResponse.json(carteProfessionnelleTravauxPublics); + }; diff --git a/cypress/mocks/handlers/conformite.ts b/cypress/mocks/handlers/conformite.ts new file mode 100644 index 000000000..c130c926f --- /dev/null +++ b/cypress/mocks/handlers/conformite.ts @@ -0,0 +1,16 @@ +import { HttpResponse, HttpResponseResolver } from 'msw'; +import conformiteDgfip from '../../fixtures/conformite-dgfip.json'; +import conformiteMsa from '../../fixtures/conformite-msa.json'; +import conformiteUrssaf from '../../fixtures/conformite-urssaf.json'; + +export const conformiteHandler: HttpResponseResolver = ({ request }) => { + let response = {}; + if (request.url.match('dgfip')) { + response = conformiteDgfip; + } else if (request.url.match('msa')) { + response = conformiteMsa; + } else if (request.url.match('urssaf')) { + response = conformiteUrssaf; + } + return HttpResponse.json(response); +}; diff --git a/cypress/mocks/handlers/mandataires-rcs.ts b/cypress/mocks/handlers/mandataires-rcs.ts new file mode 100644 index 000000000..7a3fc89bf --- /dev/null +++ b/cypress/mocks/handlers/mandataires-rcs.ts @@ -0,0 +1,6 @@ +import { HttpResponse, HttpResponseResolver } from 'msw'; +import mandatairesRcs from '../../fixtures/mandataires-rcs.json'; + +export const mandatairesRcsHandler: HttpResponseResolver = ({ request }) => { + return HttpResponse.json(mandatairesRcs); +}; diff --git a/cypress/mocks/routes.ts b/cypress/mocks/routes.ts index 58170bec1..9664dad9c 100644 --- a/cypress/mocks/routes.ts +++ b/cypress/mocks/routes.ts @@ -22,6 +22,8 @@ import { import { associationHandler } from './handlers/association'; import { baseAdresseNationaleHandler } from './handlers/base-adresse-nationale'; import { bodaccHandler } from './handlers/bodacc'; +import { carteProfessionnelleTravauxPublicsHandler } from './handlers/carte-professionnelle-travaux-publics'; +import { conformiteHandler } from './handlers/conformite'; import { dgefpHandler } from './handlers/dgefp'; import { donneesFinancieresHandler } from './handlers/donnees-financieres'; import { educationNationaleHandler } from './handlers/education-nationale'; @@ -30,6 +32,7 @@ import { entrepreneurSpectaclesHandler } from './handlers/entrepreneur-spectacle import { eoriHandler } from './handlers/eori'; import { igHandler } from './handlers/ig'; import { journalOfficielAssociationsHandler } from './handlers/journal-officiel-associations'; +import { mandatairesRcsHandler } from './handlers/mandataires-rcs'; import { odsMetadataHandler } from './handlers/ods-metadata'; import { effectifsHandler } from './handlers/rcd-effectifs-annuels'; import { rechercheEntrepriseHandler } from './handlers/recherche-entreprises'; @@ -107,5 +110,41 @@ export const routesHandlers = [ journalOfficielAssociationsHandler ), http.get(routes.journalOfficielAssociations.ods.metadata, odsMetadataHandler), - http.get(routes.apiEntreprise.effectifs.annuels('*', '*'), effectifsHandler), + http.get( + `${process.env.API_ENTREPRISE_URL}${routes.apiEntreprise.effectifs.annuels( + '*', + '*' + )}`, + effectifsHandler + ), + http.get( + `${process.env.API_ENTREPRISE_URL}${routes.apiEntreprise.conformite.fiscale( + '*' + )}`, + conformiteHandler + ), + http.get( + `${ + process.env.API_ENTREPRISE_URL + }${routes.apiEntreprise.conformite.vigilance('*')}`, + conformiteHandler + ), + http.get( + `${process.env.API_ENTREPRISE_URL}${routes.apiEntreprise.conformite.msa( + '*' + )}`, + conformiteHandler + ), + http.get( + `${ + process.env.API_ENTREPRISE_URL + }${routes.apiEntreprise.carteProfessionnelleTravauxPublics('*')}`, + carteProfessionnelleTravauxPublicsHandler + ), + http.get( + `${process.env.API_ENTREPRISE_URL}${routes.apiEntreprise.mandatairesRCS( + '*' + )}`, + mandatairesRcsHandler + ), ]; diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 14c1c69aa..9c448f2cc 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -40,7 +40,6 @@ const generateSessionCookie = async () => { 'rne', 'pseudo_opendata', 'effectifs_annuels', - 'dgfip', ], userType: 'Super-agent connecté', hasHabilitation: true, diff --git a/tsconfig.json b/tsconfig.json index caa855747..5b3e42f62 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -29,6 +29,6 @@ } ] }, - "exclude": ["node_modules", "stories"], + "exclude": ["node_modules", "cypress", "cypress.config.ts"], "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"] }