Files
actions-playground/src/components/MainContent.test.jsx
T
tom.coursow 3338f2549e
Gitea Actions Demo / Build (push) Successful in 42s
Gitea Actions Demo / Test-Job (push) Successful in 7s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 18s
Reverted test so that Actions Workflow passes again
2023-07-12 13:53:41 +02:00

22 lines
618 B
React

import '@testing-library/jest-dom';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import MainContent from './MainContent';
describe('MainContent', () => {
it('should render a button', () => {
render(<MainContent />);
expect(screen.getByRole('button')).toBeInTheDocument();
});
it('should show the help area after clicking the button', async () => {
render(<MainContent />);
const button = screen.getByRole('button');
await userEvent.click(button);
expect(screen.getByTestId('help-area')).toBeInTheDocument();
});
});