From 89ab047a8011db03829bb7c9254f962cf1173d43 Mon Sep 17 00:00:00 2001 From: daniel-pohl Date: Tue, 4 Jun 2024 16:51:09 +0200 Subject: [PATCH] fixed frontend test --- .../RestaurantCard/RestaurantCard.component.test.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/RestaurantCard/RestaurantCard.component.test.tsx b/frontend/src/components/RestaurantCard/RestaurantCard.component.test.tsx index 327450e..daee601 100644 --- a/frontend/src/components/RestaurantCard/RestaurantCard.component.test.tsx +++ b/frontend/src/components/RestaurantCard/RestaurantCard.component.test.tsx @@ -2,17 +2,18 @@ import {render, screen} from '@testing-library/react'; import '@testing-library/jest-dom'; import RestaurantCard from "./RestaurantCard.tsx"; import {RestaurantType} from "../../model/Restaurant.ts"; +import {BrowserRouter} from "react-router-dom"; test('RestaurantCard component displays title of the restaurant', () => { const restaurant: RestaurantType = {id: "1", title: "Don Carlos", city: "Berlin"} - render(); + render(); const restaurantTitle = screen.getByText(/Don Carlos/i); expect(restaurantTitle).toBeInTheDocument(); }); test("RestaurantCard component displays the title of the restaurant as h2", () => { const restaurant: RestaurantType = {id: "1", title: "Don Carlos", city: "Berlin"} - render(); + render(); const restaurantTitle = screen.getByRole("heading", { level: 2, name: /don carlos/i @@ -22,7 +23,7 @@ test("RestaurantCard component displays the title of the restaurant as h2", () = test("RestaurantCard component displays the city", () => { const restaurant: RestaurantType = {id: "1", title: "Don Carlos", city: "Berlin"} - render(); + render(); const restaurantCity = screen.getByText(/Berlin/i); expect(restaurantCity).toBeInTheDocument(); }) \ No newline at end of file