update icon event preview modal

This commit is contained in:
lenhanphung
2026-02-04 15:31:12 +07:00
parent 201f9c722b
commit 309ac0d23b
6 changed files with 46 additions and 26 deletions
@@ -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", () => {
+5 -3
View File
@@ -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;
}
/**