diff --git a/plugins/scaffolder/src/next/OngoingTask/OngoingTask.test.tsx b/plugins/scaffolder/src/next/OngoingTask/OngoingTask.test.tsx index 16d9740c15..9d3f29fe7b 100644 --- a/plugins/scaffolder/src/next/OngoingTask/OngoingTask.test.tsx +++ b/plugins/scaffolder/src/next/OngoingTask/OngoingTask.test.tsx @@ -112,4 +112,29 @@ describe('OngoingTask', () => { expect(getByTestId('cancel-button')).toHaveClass('Mui-disabled'); }); }); + + it('should initially do not display logs', async () => { + const rendered = await renderInTestApp( + + + , + { mountedRoutes: { '/': rootRouteRef } }, + ); + await expect(rendered.findByText('Show Logs')).resolves.toBeInTheDocument(); + }); + + it('should toggle logs visibility', async () => { + const rendered = await renderInTestApp( + + + , + { mountedRoutes: { '/': rootRouteRef } }, + ); + await act(async () => { + const element = await rendered.findByText('Show Logs'); + fireEvent.click(element); + }); + + await expect(rendered.findByText('Hide Logs')).resolves.toBeInTheDocument(); + }); });