[tests] removed noisy warnings

This commit is contained in:
Camille Moussu
2025-07-30 15:23:00 +02:00
committed by Benoit TELLIER
parent d7b3d4e077
commit eac718cfdc
2 changed files with 26 additions and 8 deletions
+13 -8
View File
@@ -26,6 +26,7 @@ import {
import { Calendars } from "../../features/Calendars/CalendarTypes";
import { push } from "redux-first-history";
import EventDisplayModal from "../../features/Events/EventDisplay";
import { createSelector } from "@reduxjs/toolkit";
export default function CalendarApp() {
const calendarRef = useRef<CalendarApi | null>(null);
@@ -41,14 +42,18 @@ export default function CalendarApp() {
const calendars = useAppSelector((state) => state.calendars.list);
const pending = useAppSelector((state) => state.calendars.pending);
const userId = useAppSelector((state) => state.user.userData.openpaasId);
const userPersonnalCalendars: Calendars[] = useAppSelector((state) =>
Object.keys(state.calendars.list).map((id) => {
if (id.split("/")[0] === userId) {
return state.calendars.list[id];
}
return {} as Calendars;
})
const selectPersonnalCalendars = createSelector(
(state) => state.calendars,
(calendars) =>
Object.keys(calendars.list).map((id) => {
if (id.split("/")[0] === userId) {
return calendars.list[id];
}
return {} as Calendars;
})
);
const userPersonnalCalendars: Calendars[] = useAppSelector(
selectPersonnalCalendars
);
let personnalEvents: CalendarEvent[] = [];
Object.keys(userPersonnalCalendars).forEach((value, id) => {
+13
View File
@@ -15,3 +15,16 @@ jest.mock("openid-client", () => ({
authorizationCodeGrant: jest.fn(),
fetchUserInfo: jest.fn(),
}));
const originalWarn = console.warn;
beforeAll(() => {
console.warn = (...args: unknown[]) => {
if (
typeof args[0] === "string" &&
args[0].includes("React Router Future Flag Warning")
) {
return;
}
originalWarn(...args);
};
});