-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat(deepsource): fix async issues
- Loading branch information
1 parent
14f6cb6
commit ec8e8de
Showing
15 changed files
with
174 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { render, screen } from "@testing-library/react"; | ||
|
||
import { USE_ROUTER_PARAMS } from "@/tests/constants"; | ||
import { TestProviders } from "@/tests/Provider"; | ||
|
||
import { NotFound } from "./NotFound"; | ||
import { ServerError } from "./ServerError"; | ||
import { UnAuthorized } from "./UnAuthorized"; | ||
|
||
describe("Error pages", () => { | ||
beforeAll(() => { | ||
const useRouter = jest.spyOn(require("next/router"), "useRouter"); | ||
useRouter.mockImplementation(USE_ROUTER_PARAMS({})); | ||
}); | ||
|
||
it("renders the 500 error page", () => { | ||
render( | ||
<TestProviders> | ||
<ServerError /> | ||
</TestProviders> | ||
); | ||
|
||
expect(screen.getByRole("heading", { level: 1 })).toHaveTextContent("500"); | ||
expect(screen.getByRole("heading", { level: 3 })).toHaveTextContent( | ||
"Internal Server Error" | ||
); | ||
}); | ||
|
||
it("renders the 403 error page", () => { | ||
render( | ||
<TestProviders> | ||
<UnAuthorized /> | ||
</TestProviders> | ||
); | ||
|
||
expect(screen.getByRole("heading", { level: 1 })).toHaveTextContent("403"); | ||
expect(screen.getByRole("heading", { level: 3 })).toHaveTextContent( | ||
"Unauthorized" | ||
); | ||
}); | ||
|
||
it("renders the 404 error page", () => { | ||
render( | ||
<TestProviders> | ||
<NotFound /> | ||
</TestProviders> | ||
); | ||
|
||
expect(screen.getByRole("heading", { level: 1 })).toHaveTextContent("404"); | ||
expect(screen.getByRole("heading", { level: 3 })).toHaveTextContent( | ||
"Page Not Found" | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters