diff --git a/frontend/jest.config.js b/frontend/jest.config.js
index 238fc7c8..0f57e0f6 100644
--- a/frontend/jest.config.js
+++ b/frontend/jest.config.js
@@ -6,4 +6,5 @@ module.exports = {
"\\.(css|less|scss|sass)$": "identity-obj-proxy",
},
testMatch: ["**/__tests__/**/*.test.[jt]s?(x)"],
+ transformIgnorePatterns: ["/node_modules/(?!(axios|date-fns)/)"],
};
diff --git a/frontend/package.json b/frontend/package.json
index 4aa74d1f..4b10906e 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -1,4 +1,5 @@
{
+ "license": "MIT",
"name": "frontend",
"version": "0.1.0",
"private": true,
@@ -8,15 +9,15 @@
"@mui/icons-material": "^7.3.1",
"@mui/material": "^7.3.1",
"@tanstack/react-query": "^5.85.5",
- "@testing-library/dom": "^10.4.0",
+ "@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.8.0",
"@testing-library/react": "^16.3.0",
- "@testing-library/user-event": "^13.2.1",
+ "@testing-library/user-event": "^14.6.1",
"@types/jest": "^30.0.0",
"@types/node": "^16.7.13",
"@types/react": "^19.1.12",
"@types/react-big-calendar": "^1.16.2",
- "@types/react-dom": "^19.1.8",
+ "@types/react-dom": "^19.1.9",
"@types/react-router-dom": "^5.3.3",
"axios": "^1.11.0",
"date-fns": "^4.1.0",
diff --git a/frontend/src/App.test.tsx b/frontend/src/App.test.tsx
index d76787ed..9382b9ad 100644
--- a/frontend/src/App.test.tsx
+++ b/frontend/src/App.test.tsx
@@ -1,4 +1,3 @@
-import React from "react";
import { render, screen } from "@testing-library/react";
import App from "./App";
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index 05f9c726..6354e451 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -1,4 +1,3 @@
-import React from "react";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import LandingPage from "./pages/LandingPage";
diff --git a/frontend/src/__tests__/components/BookingForm.test.tsx b/frontend/src/__tests__/components/BookingForm.test.tsx
index e62168f1..37ab61b0 100644
--- a/frontend/src/__tests__/components/BookingForm.test.tsx
+++ b/frontend/src/__tests__/components/BookingForm.test.tsx
@@ -1,6 +1,5 @@
// BookingForm.test.tsx
-import React from "react";
import { render, screen } from "@testing-library/react";
import BookingForm from "../../components/BookingForm";
diff --git a/frontend/src/__tests__/components/BookingList.test.tsx b/frontend/src/__tests__/components/BookingList.test.tsx
index 0ff17855..cadc5feb 100644
--- a/frontend/src/__tests__/components/BookingList.test.tsx
+++ b/frontend/src/__tests__/components/BookingList.test.tsx
@@ -4,7 +4,7 @@
* @remarks
* Tests rendering of booking data and empty state handling.
*/
-import { render, screen, act } from "@testing-library/react";
+import { render, screen } from "@testing-library/react";
import BookingList, { Booking } from "../../components/BookingList";
describe("BookingList", () => {
@@ -84,10 +84,8 @@ describe("BookingList", () => {
expect(screen.getByText("Initial Meeting")).toBeInTheDocument();
// Simulate SSE message
- act(() => {
- mockEventSourceInstance.onmessage({
- data: JSON.stringify({ bookings: newBookings }),
- });
+ mockEventSourceInstance.onmessage({
+ data: JSON.stringify({ bookings: newBookings }),
});
// New booking should be rendered
diff --git a/frontend/src/__tests__/components/CalendarView.test.tsx b/frontend/src/__tests__/components/CalendarView.test.tsx
index 4f1449b1..3fc64adf 100644
--- a/frontend/src/__tests__/components/CalendarView.test.tsx
+++ b/frontend/src/__tests__/components/CalendarView.test.tsx
@@ -1,6 +1,5 @@
// CalendarView.test.tsx
-import React from "react";
import { render, screen } from "@testing-library/react";
import CalendarView from "../../components/CalendarView";
diff --git a/frontend/src/__tests__/components/RoomEquipmentList.test.tsx b/frontend/src/__tests__/components/RoomEquipmentList.test.tsx
index 91d41ec0..a7f8eae1 100644
--- a/frontend/src/__tests__/components/RoomEquipmentList.test.tsx
+++ b/frontend/src/__tests__/components/RoomEquipmentList.test.tsx
@@ -1,5 +1,4 @@
// RoomEquipmentList.test.tsx
-import React from "react";
import { render, screen } from "@testing-library/react";
import RoomEquipmentList from "../../components/RoomEquipmentList";
diff --git a/frontend/src/__tests__/pages/BookingPage.test.tsx b/frontend/src/__tests__/pages/BookingPage.test.tsx
index 0335de73..22fbb145 100644
--- a/frontend/src/__tests__/pages/BookingPage.test.tsx
+++ b/frontend/src/__tests__/pages/BookingPage.test.tsx
@@ -1,5 +1,4 @@
// BookingPage.test.tsx
-import React from "react";
import { render, screen, waitFor } from "@testing-library/react";
import BookingPage from "../../pages/BookingPage";
diff --git a/frontend/src/__tests__/pages/LandingPage.test.tsx b/frontend/src/__tests__/pages/LandingPage.test.tsx
index 0e119d2b..6db3c5e5 100644
--- a/frontend/src/__tests__/pages/LandingPage.test.tsx
+++ b/frontend/src/__tests__/pages/LandingPage.test.tsx
@@ -8,7 +8,8 @@
* - GET `/bookings/room/{roomId}?date={YYYY-MM-DD}`: Returns Booking[] for the selected room and date.
*/
-import { render, screen, waitFor, act } from "@testing-library/react";
+import { render, screen, waitFor } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
import { MemoryRouter } from "react-router-dom";
import axios from "axios";
import LandingPage from "../../pages/LandingPage";
@@ -96,11 +97,9 @@ describe("LandingPage", () => {
// Wait for bookings for Room A
await screen.findByText("Meeting A");
- // Select Room B (wrap in act to avoid warning)
+ // Select Room B
const roomB = screen.getByTestId("room-item-2");
- await act(async () => {
- roomB.click();
- });
+ await userEvent.click(roomB);
// Wait for bookings for Room B
await screen.findByText("Meeting B");
diff --git a/frontend/src/components/CalendarView.tsx b/frontend/src/components/CalendarView.tsx
index 8abbc633..f2d3c124 100644
--- a/frontend/src/components/CalendarView.tsx
+++ b/frontend/src/components/CalendarView.tsx
@@ -1,3 +1,4 @@
+import React from "react";
/**
* CalendarView component
*
@@ -7,7 +8,6 @@
* @example
*