mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 09:36:27 +00:00
test: extend testRender to return spy on dispatch
This commit is contained in:
@@ -10,7 +10,7 @@ import AboutDialog from './AboutDialog';
|
||||
it('should close when the button is clicked', () => {
|
||||
const close = jest.fn();
|
||||
|
||||
const dialog = testRender(<AboutDialog isOpen={true} onClose={() => close()} />);
|
||||
const [dialog] = testRender(<AboutDialog isOpen={true} onClose={() => close()} />);
|
||||
|
||||
userEvent.click(dialog.getByLabelText('Close'));
|
||||
|
||||
@@ -18,7 +18,9 @@ it('should close when the button is clicked', () => {
|
||||
});
|
||||
|
||||
it('should manage license dialog open/close', async () => {
|
||||
const dialog = testRender(<AboutDialog isOpen={true} onClose={() => undefined} />);
|
||||
const [dialog] = testRender(
|
||||
<AboutDialog isOpen={true} onClose={() => undefined} />,
|
||||
);
|
||||
|
||||
userEvent.click(dialog.getByText('Software Licenses'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user