Skip to content

Commit

Permalink
Fixing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
kaennchenstruggle committed Oct 30, 2023
1 parent 40b3006 commit a033ae5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/unit/modules/default/calendar/calendar_utils_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ describe("Calendar utils tests", () => {

describe("titleTransform and shorten combined", () => {
it("should replace the birthday and wrap nicely", () => {
const transformedTitle = CalendarUtils.titleTransform("Michael Teeuw's birthday", { search: "'s birthday", replace: "" });
const transformedTitle = CalendarUtils.titleTransform("Michael Teeuw's birthday", [{ search: "'s birthday", replace: "" }]);
expect(CalendarUtils.shorten(transformedTitle, 10, true, 2)).toBe("Michael <br>Teeuw");
});
});

describe("titleTransform with yearmatchgroup", () => {
it("should replace the birthday and wrap nicely", () => {
const transformedTitle = CalendarUtils.titleTransform("Luciella '2000", { search: "^([^']*) '(\\d{4})$", replace: "$1 ($2.)", yearmatchgroup: 2 });
const transformedTitle = CalendarUtils.titleTransform("Luciella '2000", [{ search: "^([^']*) '(\\d{4})$", replace: "$1 ($2.)", yearmatchgroup: 2 }]);
const expectedResult = `Luciella (${new Date().getFullYear() - 2000}.)`;
expect(transformedTitle).toBe(expectedResult);
});
Expand Down

0 comments on commit a033ae5

Please sign in to comment.