mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-10 18:03:47 +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,36 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import SocketProvider from 'app/context/socketContext';
|
||||
import MessageControl from '../MessageControl';
|
||||
|
||||
// need to inject the socket provider to make component
|
||||
// render without failing
|
||||
const MockMessageControl = () => {
|
||||
return (
|
||||
<SocketProvider>
|
||||
<MessageControl />
|
||||
</SocketProvider>
|
||||
);
|
||||
};
|
||||
|
||||
describe('Message Control input blocks', () => {
|
||||
test('Presenter dialog', async () => {
|
||||
// Presenter dialog and button
|
||||
// substring match, ignore case
|
||||
render(<MockMessageControl />);
|
||||
expect(screen.getByPlaceholderText(/presenter/i)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('Public dialog', async () => {
|
||||
// Public dialog and button
|
||||
// substring match, ignore case
|
||||
render(<MockMessageControl />);
|
||||
expect(screen.getByPlaceholderText(/public/i)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('Lower third', async () => {
|
||||
// Lower third dialog and button
|
||||
// substring match, ignore case
|
||||
render(<MockMessageControl />);
|
||||
expect(screen.getByPlaceholderText(/lower third/i)).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user