Skip to content

Commit

Permalink
test: attempt to find a reason of freezing test #7
Browse files Browse the repository at this point in the history
  • Loading branch information
Tedzury committed Dec 26, 2023
1 parent b171ba7 commit 9f2273f
Showing 1 changed file with 89 additions and 89 deletions.
178 changes: 89 additions & 89 deletions src/test/docsComponent/SomeCompletelyDiffFile.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,95 +43,95 @@ describe('Testing for docs component', () => {
expect(screen.queryByText('A GraphQL schema provides a root type for each kind of operation.')).toBeNull();
}).catch(() => {});
});
it('Should close docs section after clicking on close docs button', async () => {
render(<App />);
const showDocsBtn = screen.getByText('show docs');
expect(screen.queryByTestId('overlay')).toBeNull();
expect(screen.queryByText('Docs')).toBeNull();
expect(screen.queryByText('A GraphQL schema provides a root type for each kind of operation')).toBeNull();
await act(async () => {
fireEvent.click(showDocsBtn);
});
const closeDocsBtn = await screen.findByText('closeDocs');
expect(await screen.findByTestId('overlay')).toBeInTheDocument();
expect(await screen.findByText('Docs')).toBeInTheDocument();
expect(
await screen.findByText('A GraphQL schema provides a root type for each kind of operation.'),
).toBeInTheDocument();
await act(async () => {
fireEvent.click(closeDocsBtn);
});
waitForElementToBeRemoved(() => {
expect(screen.queryByTestId('overlay')).toBeNull();
expect(screen.queryByText('Docs')).toBeNull();
expect(screen.queryByText('A GraphQL schema provides a root type for each kind of operation.')).toBeNull();
}).catch(() => {});
});
it('Should navigate and display info about proper type after cliking on that type', async () => {
render(<App />);
const showDocsBtn = screen.getByText('show docs');
await act(async () => {
fireEvent.click(showDocsBtn);
});
const booleanTypeLink = await screen.findByText('Boolean');
expect(booleanTypeLink).toBeInTheDocument();
await act(async () => {
fireEvent.click(booleanTypeLink);
});
expect(await screen.findByText('The `Boolean` scalar type represents `true` or `false`.')).toBeInTheDocument();
});
it('Should navigate and display info about proper info about root type after cliking on that type', async () => {
render(<App />);
const showDocsBtn = screen.getByText('show docs');
await act(async () => {
fireEvent.click(showDocsBtn);
});
const RootTypeLink = await screen.findByText('Root');
await act(async () => {
fireEvent.click(RootTypeLink);
});
expect(await screen.findByText('Fields:')).toBeInTheDocument();
});
it('Should navigate and display info about proper info about root type after cliking on that type and all following clicked types as well as navigating back', async () => {
render(<App />);
const showDocsBtn = screen.getByText('show docs');
await act(async () => {
fireEvent.click(showDocsBtn);
});
const RootTypeLink = await screen.findByText('Root');
await act(async () => {
fireEvent.click(RootTypeLink);
});
expect(await screen.findByText('Fields:')).toBeInTheDocument();
const filmsLink = await screen.findByText('Film');
expect(filmsLink).toBeInTheDocument();
await act(async () => {
fireEvent.click(filmsLink);
});
expect(await screen.findByText('Implements:')).toBeInTheDocument();
const nodeTypeLink = await screen.findByText('Node');
expect(nodeTypeLink).toBeInTheDocument();
await act(async () => {
fireEvent.click(nodeTypeLink);
});
expect(await screen.findByText('Implementations')).toBeInTheDocument();
const backToFilmBtn = await screen.findByRole('button', { name: 'Film' });
await act(async () => {
fireEvent.click(backToFilmBtn);
});
const backToRootBtn = await screen.findByRole('button', { name: 'Root' });
await act(async () => {
fireEvent.click(backToRootBtn);
});
const backToDocsBtn = await screen.findByRole('button', { name: 'Docs' });
await act(async () => {
fireEvent.click(backToDocsBtn);
});
expect(await screen.findByText('Docs')).toBeInTheDocument();
expect(
await screen.findByText('A GraphQL schema provides a root type for each kind of operation.'),
).toBeInTheDocument();
});
// it('Should close docs section after clicking on close docs button', async () => {
// render(<App />);
// const showDocsBtn = screen.getByText('show docs');
// expect(screen.queryByTestId('overlay')).toBeNull();
// expect(screen.queryByText('Docs')).toBeNull();
// expect(screen.queryByText('A GraphQL schema provides a root type for each kind of operation')).toBeNull();
// await act(async () => {
// fireEvent.click(showDocsBtn);
// });
// const closeDocsBtn = await screen.findByText('closeDocs');
// expect(await screen.findByTestId('overlay')).toBeInTheDocument();
// expect(await screen.findByText('Docs')).toBeInTheDocument();
// expect(
// await screen.findByText('A GraphQL schema provides a root type for each kind of operation.'),
// ).toBeInTheDocument();
// await act(async () => {
// fireEvent.click(closeDocsBtn);
// });
// waitForElementToBeRemoved(() => {
// expect(screen.queryByTestId('overlay')).toBeNull();
// expect(screen.queryByText('Docs')).toBeNull();
// expect(screen.queryByText('A GraphQL schema provides a root type for each kind of operation.')).toBeNull();
// }).catch(() => {});
// });
// it('Should navigate and display info about proper type after cliking on that type', async () => {
// render(<App />);
// const showDocsBtn = screen.getByText('show docs');
// await act(async () => {
// fireEvent.click(showDocsBtn);
// });
// const booleanTypeLink = await screen.findByText('Boolean');
// expect(booleanTypeLink).toBeInTheDocument();
// await act(async () => {
// fireEvent.click(booleanTypeLink);
// });
// expect(await screen.findByText('The `Boolean` scalar type represents `true` or `false`.')).toBeInTheDocument();
// });
// it('Should navigate and display info about proper info about root type after cliking on that type', async () => {
// render(<App />);
// const showDocsBtn = screen.getByText('show docs');
// await act(async () => {
// fireEvent.click(showDocsBtn);
// });
// const RootTypeLink = await screen.findByText('Root');
// await act(async () => {
// fireEvent.click(RootTypeLink);
// });
// expect(await screen.findByText('Fields:')).toBeInTheDocument();
// });
// it('Should navigate and display info about proper info about root type after cliking on that type and all following clicked types as well as navigating back', async () => {
// render(<App />);
// const showDocsBtn = screen.getByText('show docs');
// await act(async () => {
// fireEvent.click(showDocsBtn);
// });
// const RootTypeLink = await screen.findByText('Root');
// await act(async () => {
// fireEvent.click(RootTypeLink);
// });
// expect(await screen.findByText('Fields:')).toBeInTheDocument();
// const filmsLink = await screen.findByText('Film');
// expect(filmsLink).toBeInTheDocument();
// await act(async () => {
// fireEvent.click(filmsLink);
// });
// expect(await screen.findByText('Implements:')).toBeInTheDocument();
// const nodeTypeLink = await screen.findByText('Node');
// expect(nodeTypeLink).toBeInTheDocument();
// await act(async () => {
// fireEvent.click(nodeTypeLink);
// });
// expect(await screen.findByText('Implementations')).toBeInTheDocument();
// const backToFilmBtn = await screen.findByRole('button', { name: 'Film' });
// await act(async () => {
// fireEvent.click(backToFilmBtn);
// });
// const backToRootBtn = await screen.findByRole('button', { name: 'Root' });
// await act(async () => {
// fireEvent.click(backToRootBtn);
// });
// const backToDocsBtn = await screen.findByRole('button', { name: 'Docs' });
// await act(async () => {
// fireEvent.click(backToDocsBtn);
// });
// expect(await screen.findByText('Docs')).toBeInTheDocument();
// expect(
// await screen.findByText('A GraphQL schema provides a root type for each kind of operation.'),
// ).toBeInTheDocument();
// });
it('fake', () => {
expect(1).toBe(1);
});
Expand Down

0 comments on commit 9f2273f

Please sign in to comment.