Update alert-button.test.jsx

This commit is contained in:
Steve Kinney
2024-10-02 15:38:02 -05:00
parent a3b3d154c3
commit 579a55a4ae

View File

@@ -3,12 +3,25 @@ import userEvent from '@testing-library/user-event';
import { AlertButton } from './alert-button'; import { AlertButton } from './alert-button';
describe.todo('AlertButton', () => { describe('AlertButton', () => {
beforeEach(() => {}); beforeEach(() => {});
afterEach(() => {}); afterEach(() => {});
it('should render an alert button', async () => {}); it('should render an alert button', async () => {});
it('should trigger an alert', async () => {}); it.only('should trigger an alert', async () => {
// const logSpy = vi.spyOn(console, 'log').mockImplementation(() => {})
render(<AlertButton />);
const input = screen.getByLabelText('Message');
const button = screen.getByRole('button', { name: /trigger alert/i });
await act(async () => {
await userEvent.type(input, 'Hello');
});
// Click on the button.
// Look and see if alert() was called with the message.
});
}); });