Skip to content

Commit

Permalink
default shortTitle
Browse files Browse the repository at this point in the history
  • Loading branch information
carolineBda committed Jul 24, 2023
1 parent f7982fa commit d5a3630
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,13 @@ describe("Test enterprise endpoint", () => {
"1090-services-de-lautomobile-commerce-et-reparation-de-lautomobile-du-cycle"
);

expect(
response.body.entreprises[0].conventions.find(
(agreement) => agreement.num === 99999
).slug
).toBeUndefined();
const agreementNoSlug = response.body.entreprises[0].conventions.find(
(agreement) => agreement.num === 99999
);
expect(agreementNoSlug.slug).toBeUndefined();
expect(agreementNoSlug.shortTitle).toEqual(
"Convention collective non reconnue"
);
});

test("Call retrieving agreement not in elastic from an enterprise", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { IDCC_TO_REPLACE } from "../../config";
const toAgreement = (convention: Convention): Agreement => ({
id: convention.id,
num: convention.idcc,
shortTitle: convention.shortTitle,
shortTitle: convention.shortTitle ?? "Convention collective non reconnue",
title: convention.title,
...(convention.url ? { url: convention.url } : {}),
});
Expand Down

0 comments on commit d5a3630

Please sign in to comment.