[tests] removed noisy warnings
This commit is contained in:
committed by
Benoit TELLIER
parent
d7b3d4e077
commit
eac718cfdc
@@ -26,6 +26,7 @@ import {
|
|||||||
import { Calendars } from "../../features/Calendars/CalendarTypes";
|
import { Calendars } from "../../features/Calendars/CalendarTypes";
|
||||||
import { push } from "redux-first-history";
|
import { push } from "redux-first-history";
|
||||||
import EventDisplayModal from "../../features/Events/EventDisplay";
|
import EventDisplayModal from "../../features/Events/EventDisplay";
|
||||||
|
import { createSelector } from "@reduxjs/toolkit";
|
||||||
|
|
||||||
export default function CalendarApp() {
|
export default function CalendarApp() {
|
||||||
const calendarRef = useRef<CalendarApi | null>(null);
|
const calendarRef = useRef<CalendarApi | null>(null);
|
||||||
@@ -41,14 +42,18 @@ export default function CalendarApp() {
|
|||||||
const calendars = useAppSelector((state) => state.calendars.list);
|
const calendars = useAppSelector((state) => state.calendars.list);
|
||||||
const pending = useAppSelector((state) => state.calendars.pending);
|
const pending = useAppSelector((state) => state.calendars.pending);
|
||||||
const userId = useAppSelector((state) => state.user.userData.openpaasId);
|
const userId = useAppSelector((state) => state.user.userData.openpaasId);
|
||||||
|
const selectPersonnalCalendars = createSelector(
|
||||||
const userPersonnalCalendars: Calendars[] = useAppSelector((state) =>
|
(state) => state.calendars,
|
||||||
Object.keys(state.calendars.list).map((id) => {
|
(calendars) =>
|
||||||
if (id.split("/")[0] === userId) {
|
Object.keys(calendars.list).map((id) => {
|
||||||
return state.calendars.list[id];
|
if (id.split("/")[0] === userId) {
|
||||||
}
|
return calendars.list[id];
|
||||||
return {} as Calendars;
|
}
|
||||||
})
|
return {} as Calendars;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
const userPersonnalCalendars: Calendars[] = useAppSelector(
|
||||||
|
selectPersonnalCalendars
|
||||||
);
|
);
|
||||||
let personnalEvents: CalendarEvent[] = [];
|
let personnalEvents: CalendarEvent[] = [];
|
||||||
Object.keys(userPersonnalCalendars).forEach((value, id) => {
|
Object.keys(userPersonnalCalendars).forEach((value, id) => {
|
||||||
|
|||||||
@@ -15,3 +15,16 @@ jest.mock("openid-client", () => ({
|
|||||||
authorizationCodeGrant: jest.fn(),
|
authorizationCodeGrant: jest.fn(),
|
||||||
fetchUserInfo: 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);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user