1
0
Fork 0
mirror of https://github.com/betagouv/mon-entreprise synced 2025-02-11 16:45:01 +00:00
mon-entreprise/site/test/fabrique-social.test.ts

47 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { describe, expect, it } from 'vitest'
import { fabriqueSocialEntrepriseAdapter } from '@/api/RechercheEntreprise/fabrique-social'
import {
fabriqueSocialWithoutSiege,
fabriqueSocialWithSiege,
} from './fabrique-social.fixtures'
describe('Fabrique Social', () => {
describe('fabriqueSocialEntrepriseAdapter', () => {
describe('Si lentreprise est retournée avec un siège différent de la recherche', () => {
const entreprise = fabriqueSocialEntrepriseAdapter(
fabriqueSocialWithSiege
)
it('retourne le siren', () => {
expect(entreprise.siren).toBe('849074190')
})
it("a l'établissement demandé dans 'établissement'", () => {
expect(entreprise.siège?.adresse.complète).toBe(
'23 RUE DE MOGADOR 75009 PARIS 9'
)
})
it("a le siège dans 'siège'", () => {
expect(entreprise.établissement.adresse.complète).toBe(
'4 RUE VOLTAIRE 44000 NANTES'
)
})
})
describe("Si l'entreprise est retournée sans siège", () => {
const entreprise = fabriqueSocialEntrepriseAdapter(
fabriqueSocialWithoutSiege
)
it("n'a pas de siège", () => {
expect(entreprise.siège?.adresse.complète).toBe(undefined)
})
it('a létablissement demandé', () => {
expect(entreprise.établissement.adresse.complète).toBe(
'4 RUE VOLTAIRE 44000 NANTES'
)
})
})
})
})