ci #1

Merged
Branden.Jones merged 7 commits from ci into main 2024-04-26 15:50:24 +02:00
4 changed files with 43 additions and 1 deletions
Showing only changes of commit 8d25159d0c - Show all commits

View File

@ -1,4 +1,10 @@
import RestaurantScreen from './components/RestaurantScreen';
export default function App()
{
return <div>Hello, World</div>
return
(
<div>
<RestaurantScreen />
</div>
)
}

View File

@ -0,0 +1,11 @@
import { useEffect } from "react";
export default function RestaurantList({ loadRestaurants })
{
useEffect(() => { loadRestaurants(); }, [loadRestaurants]);
return
(
<div>RestaurantList</div>
)
}

View File

@ -0,0 +1,12 @@
import { render } from '@testing-library/react';
import RestaurantList from './RestaurantList';
describe('RestaurantList', () =>
{
it('loads restaurants on first render', () =>
{
const loadRestaurants = jest.fn().mockName('loadRestaurnats');
render(<RestaurantList loadRestaurants={loadRestaurants} />);
expect(loadRestaurants).toHaveBeenCalled();
});
});

View File

@ -0,0 +1,13 @@
import RestaurantList from "./RestaurantList";
export default function RestaurantScreen()
{
return
(
<div>
<h1>Restaurants</h1>
<RestaurantList />
</div>
)
}