update icon event preview modal
This commit is contained in:
@@ -45,11 +45,11 @@ describe("videoConferenceUtils", () => {
|
||||
});
|
||||
|
||||
describe("addVideoConferenceToDescription", () => {
|
||||
it("should add video conference footer to empty description", () => {
|
||||
it("should add video conference on first line when description is empty", () => {
|
||||
const description = "";
|
||||
const meetingLink = "https://meet.linagora.com/abc-defg-hij";
|
||||
const result = addVideoConferenceToDescription(description, meetingLink);
|
||||
expect(result).toBe("\nVisio: https://meet.linagora.com/abc-defg-hij");
|
||||
expect(result).toBe("Visio: https://meet.linagora.com/abc-defg-hij");
|
||||
});
|
||||
|
||||
it("should add video conference footer to existing description", () => {
|
||||
|
||||
@@ -33,7 +33,8 @@ export function generateMeetingLink(baseUrl?: string): string {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add video conference footer to event description
|
||||
* Add video conference footer to event description.
|
||||
* If description is empty, adds on first line; otherwise adds on the line below existing content.
|
||||
* @param {string} description - Original description
|
||||
* @param {string} meetingLink - Generated meeting link
|
||||
* @returns {string} Description with video conference footer
|
||||
@@ -42,8 +43,9 @@ export function addVideoConferenceToDescription(
|
||||
description: string,
|
||||
meetingLink: string
|
||||
): string {
|
||||
const footer = `\nVisio: ${meetingLink}`;
|
||||
return description + footer;
|
||||
const line = `Visio: ${meetingLink}`;
|
||||
const trimmed = description.trimEnd();
|
||||
return trimmed ? `${trimmed}\n${line}` : line;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user