mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 12:53:32 +00:00
Chore/tests (#73)
* chore/tests: install testing libraries * chore/tests: upgrade dependencies * chore/tests: configure linters * chore/tests: add basic component tests * chore/tests: version bump
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import SocketProvider from 'app/context/socketContext';
|
||||
import { QueryClient, QueryClientProvider } from 'react-query';
|
||||
import Info from '../Info';
|
||||
|
||||
const queryClient = new QueryClient();
|
||||
|
||||
test('check static info render', async () => {
|
||||
// need to inject the socket provider to make component
|
||||
// render without failing
|
||||
render(
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<SocketProvider>
|
||||
<Info />
|
||||
</SocketProvider>
|
||||
</QueryClientProvider>
|
||||
);
|
||||
|
||||
// Info titles
|
||||
// substring match, ignore case
|
||||
expect(screen.getByText(/running/i)).toBeInTheDocument();
|
||||
expect(screen.getByText(/event/i)).toBeInTheDocument();
|
||||
});
|
||||
Reference in New Issue
Block a user