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:
Abhishek Jakhar
2020-10-19 14:03:30 +05:30
committed by GitHub
parent 9150fd1631
commit 782f3b3541
7 changed files with 68 additions and 6 deletions
@@ -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();
});
});