Add test case for Progress component (#2953)
* remove data-testid from div * add test case for Progress component * add changeset * update the GraphiQLPage test cases to handle Progress timeout * update the RadarComponent and RadarPage test case to handle Progress timeout * update the TechDocsProgressBar test case to handle Progress timeout * add changeset
This commit is contained in:
@@ -25,12 +25,14 @@ jest.useFakeTimers();
|
||||
describe('<TechDocsProgressBar />', () => {
|
||||
it('should render a message if techdocs page takes more time to load', () => {
|
||||
const rendered = render(wrapInTestApp(<TechDocsProgressBar />));
|
||||
|
||||
expect(rendered.getByTestId('progress')).toBeDefined();
|
||||
act(() => {
|
||||
jest.advanceTimersByTime(250);
|
||||
});
|
||||
expect(rendered.getByTestId('progress')).toBeInTheDocument();
|
||||
expect(rendered.queryByTestId('delay-reason')).toBeNull();
|
||||
act(() => {
|
||||
jest.advanceTimersByTime(5000);
|
||||
});
|
||||
expect(rendered.getByTestId('delay-reason')).toBeDefined();
|
||||
expect(rendered.getByTestId('delay-reason')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user