-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(convention collectives): fix de la generation du slug pour les CC…
… qui sont créés (#1486)
- Loading branch information
1 parent
b899de3
commit 061e7da
Showing
4 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
targets/frontend/src/modules/agreements/__tests__/mapAgreementToDocument.test.ts
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { mapAgreementToDocument } from "../mapAgreementToDocument"; | ||
import { Agreement } from "../type"; | ||
|
||
jest.mock("../../common/getGlossaryContent.ts", () => { | ||
return { | ||
getGlossaryContent: jest.fn(() => "mocked-glossary-content"), | ||
}; | ||
}); | ||
|
||
describe("mapAgreementToDocument", () => { | ||
const agreement: Agreement = { | ||
id: "1234", | ||
isSupported: false, | ||
name: "Ma nouvelle CC du 03 Octobre 2024", | ||
shortName: "Ma nouvelle CC", | ||
synonyms: [], | ||
updatedAt: "3/10/2024", | ||
}; | ||
|
||
it("crée un nouveau document si pas de doc", async () => { | ||
const result = await mapAgreementToDocument(agreement); | ||
expect(result).toEqual({ | ||
cdtn_id: "6f8c4cc14e", | ||
document: { | ||
num: 1234, | ||
shortTitle: "Ma nouvelle CC", | ||
synonymes: [], | ||
}, | ||
initial_id: "1234", | ||
is_available: true, | ||
is_published: false, | ||
is_searchable: false, | ||
meta_description: "IDCC 1234: Ma nouvelle CC du 03 Octobre 2024", | ||
slug: "1234-ma-nouvelle-cc", | ||
source: "conventions_collectives", | ||
text: "IDCC 1234: Ma nouvelle CC du 03 Octobre 2024 Ma nouvelle CC", | ||
title: "Ma nouvelle CC du 03 Octobre 2024", | ||
}); | ||
}); | ||
}); |
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
Empty file.
7 changes: 7 additions & 0 deletions
7
targets/hasura/migrations/default/1727965175418_update_cc_clug/up.sql
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
UPDATE public.documents | ||
SET slug = '2707-batiment-etam-ile-de-france-hors-seine-et-marne' | ||
WHERE slug = 'batiment-etam-ile-de-france-hors-seine-et-marne'; | ||
|
||
UPDATE public.documents | ||
SET slug = '3251-bijouterie-joaillerie-orfevrerie-horlogerie-bjoh' | ||
WHERE slug = 'bijouterie-joaillerie-orfevrerie-horlogerie-bjoh'; |