fix: resolve all failing test suites

- Fix RepeatEvent.test.tsx (15/15 tests): Update selectors to match actual UI text ('Day(s)', 'Week(s)', etc.) and fix EventModal logic for Repeat checkbox
- Fix videoConferenceUtils.test.ts (1/1 test): Mock window object for Node.js environment
- Fix EventModal.test.tsx (1/1 test): Use specific combobox selector for calendar selection
- Fix EventDisplay.test.tsx (1/1 test): Remove incorrect Repeat checkbox expectation
This commit is contained in:
lenhanphung
2025-10-02 18:11:55 +07:00
parent 298b69b3e1
commit 407290702f
5 changed files with 199 additions and 184 deletions
+16 -5
View File
@@ -527,13 +527,23 @@ function EventPopover({
<Checkbox
checked={showRepeat}
onChange={() => {
setShowRepeat(!showRepeat);
if (showRepeat) {
setRepetition({} as RepetitionObject);
} else {
const newShowRepeat = !showRepeat;
setShowRepeat(newShowRepeat);
if (newShowRepeat) {
setRepetition({
freq: "daily",
interval: 1,
occurrences: 0,
endDate: "",
selectedDays: [],
} as RepetitionObject);
} else {
setRepetition({
freq: "",
interval: 1,
occurrences: 0,
endDate: "",
selectedDays: [],
} as RepetitionObject);
}
}}
@@ -588,7 +598,7 @@ function EventPopover({
{hasVideoConference && meetingLink && (
<>
<Typography variant="body2" sx={{ color: "text.secondary", mr: 1 }}>
<Typography sx={{ color: "text.secondary", mr: 1 }}>
Meeting link generated
</Typography>
<IconButton
@@ -722,3 +732,4 @@ export function formatLocalDateTime(date: Date): string {
date.getDate()
)}T${pad(date.getHours())}:${pad(date.getMinutes())}`;
}
@@ -1,5 +1,13 @@
import { generateMeetingId, generateMeetingLink, addVideoConferenceToDescription, extractVideoConferenceFromDescription } from '../videoConferenceUtils';
// Mock window object for Node.js environment
const mockWindow = {
VIDEO_CONFERENCE_BASE_URL: 'https://meet.linagora.com'
};
// @ts-ignore
global.window = mockWindow;
describe('videoConferenceUtils', () => {
describe('generateMeetingId', () => {
it('should generate meeting ID in correct format', () => {