fix: improve video conference link positioning and null safety
- Fix calendarUtils.ts null safety for calendars[id] access - Update video conference link to be added on line 2 instead of line 3 - Update regex in handleDeleteVideoConference to match new format - Update all test cases for videoConferenceUtils to match new format - Add null checks in updateCalsDetails function
This commit is contained in:
@@ -49,7 +49,7 @@ describe("videoConferenceUtils", () => {
|
||||
const description = "";
|
||||
const meetingLink = "https://meet.linagora.com/abc-defg-hij";
|
||||
const result = addVideoConferenceToDescription(description, meetingLink);
|
||||
expect(result).toBe("\n\nVisio: https://meet.linagora.com/abc-defg-hij");
|
||||
expect(result).toBe("\nVisio: https://meet.linagora.com/abc-defg-hij");
|
||||
});
|
||||
|
||||
it("should add video conference footer to existing description", () => {
|
||||
@@ -57,7 +57,7 @@ describe("videoConferenceUtils", () => {
|
||||
const meetingLink = "https://meet.linagora.com/abc-defg-hij";
|
||||
const result = addVideoConferenceToDescription(description, meetingLink);
|
||||
expect(result).toBe(
|
||||
"This is a meeting description.\n\nVisio: https://meet.linagora.com/abc-defg-hij"
|
||||
"This is a meeting description.\nVisio: https://meet.linagora.com/abc-defg-hij"
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -65,7 +65,7 @@ describe("videoConferenceUtils", () => {
|
||||
describe("extractVideoConferenceFromDescription", () => {
|
||||
it("should extract video conference link from description", () => {
|
||||
const description =
|
||||
"Meeting description.\n\nVisio: https://meet.linagora.com/abc-defg-hij";
|
||||
"Meeting description.\nVisio: https://meet.linagora.com/abc-defg-hij";
|
||||
const result = extractVideoConferenceFromDescription(description);
|
||||
expect(result).toBe("https://meet.linagora.com/abc-defg-hij");
|
||||
});
|
||||
|
||||
@@ -42,7 +42,7 @@ export function addVideoConferenceToDescription(
|
||||
description: string,
|
||||
meetingLink: string
|
||||
): string {
|
||||
const footer = `\n\nVisio: ${meetingLink}`;
|
||||
const footer = `\nVisio: ${meetingLink}`;
|
||||
return description + footer;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user