diff --git a/examples/element-factory/src/alert-button.test.jsx b/examples/element-factory/src/alert-button.test.jsx index 424a3ca..972c696 100644 --- a/examples/element-factory/src/alert-button.test.jsx +++ b/examples/element-factory/src/alert-button.test.jsx @@ -3,12 +3,25 @@ import userEvent from '@testing-library/user-event'; import { AlertButton } from './alert-button'; -describe.todo('AlertButton', () => { +describe('AlertButton', () => { beforeEach(() => {}); afterEach(() => {}); 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(); + 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. + }); });