chore: bump @testing-library/user-event from ^13.5.0 to 14.1.0 (#972)

This commit is contained in:
G r e y
2022-04-11 20:33:52 +00:00
committed by GitHub
parent c97180c18d
commit 2835bb45e5
3 changed files with 22 additions and 18 deletions
+1 -1
View File
@@ -50,7 +50,7 @@
"@storybook/addon-links": "6.4.21",
"@storybook/react": "6.4.21",
"@testing-library/react": "12.1.4",
"@testing-library/user-event": "^13.5.0",
"@testing-library/user-event": "14.1.0",
"@types/express": "4.17.13",
"@types/jest": "27.4.1",
"@types/node": "14.18.12",
+6 -7
View File
@@ -23,31 +23,30 @@ describe("SignInPage", () => {
render(<SignInPage />)
// Then
await screen.findByText(Language.signIn, { exact: false })
await screen.findByText(Language.signIn)
})
it("shows an error message if SignIn fails", async () => {
// Given
render(<SignInPage />)
// Make login fail
server.use(
// Make login fail
rest.post("/api/v2/users/login", async (req, res, ctx) => {
return res(ctx.status(500), ctx.json({ message: "nope" }))
}),
)
// When
// Set email / password
render(<SignInPage />)
const email = screen.getByLabelText(Language.emailLabel)
const password = screen.getByLabelText(Language.passwordLabel)
userEvent.type(email, "test@coder.com")
userEvent.type(password, "password")
await userEvent.type(email, "test@coder.com")
await userEvent.type(password, "password")
// Click sign-in
const signInButton = await screen.findByText(Language.signIn)
act(() => signInButton.click())
// Then
// Finding error by test id because it comes from the backend
const errorMessage = await screen.findByText(Language.authErrorMessage)
expect(errorMessage).toBeDefined()
expect(history.location.pathname).toEqual("/login")
+15 -10
View File
@@ -2709,9 +2709,9 @@
store2 "^2.12.0"
"@testing-library/dom@^8.0.0":
version "8.11.3"
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.11.3.tgz#38fd63cbfe14557021e88982d931e33fb7c1a808"
integrity sha512-9LId28I+lx70wUiZjLvi1DB/WT2zGOxUh46glrSNMaWVx849kKAluezVzZrXJfTKKoQTmEOutLes/bHg4Bj3aA==
version "8.13.0"
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.13.0.tgz#bc00bdd64c7d8b40841e27a70211399ad3af46f5"
integrity sha512-9VHgfIatKNXQNaZTtLnalIy0jNZzY35a4S3oi08YAt9Hv1VsfZ/DfA45lM8D/UhtHBGJ4/lGwp0PZkVndRkoOQ==
dependencies:
"@babel/code-frame" "^7.10.4"
"@babel/runtime" "^7.12.5"
@@ -2731,12 +2731,10 @@
"@testing-library/dom" "^8.0.0"
"@types/react-dom" "*"
"@testing-library/user-event@^13.5.0":
version "13.5.0"
resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-13.5.0.tgz#69d77007f1e124d55314a2b73fd204b333b13295"
integrity sha512-5Kwtbo3Y/NowpkbRuSepbyMFkZmHgD+vPzYB/RJ4oxt5Gj/avFFBYjhw27cqSVPVw/3a67NK1PbiIr9k4Gwmdg==
dependencies:
"@babel/runtime" "^7.12.5"
"@testing-library/user-event@14.1.0":
version "14.1.0"
resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-14.1.0.tgz#db479c06271b72a4d41cf595ec2ad7ff078c1d72"
integrity sha512-+CGfMXlVM+OwREHDEsfTGsXIMI+rjr3a7YBUSutq7soELht+8kQrM5k46xa/WLfHdtX/wqsDIleL6bi4i+xz0w==
"@tootallnate/once@1":
version "1.1.2"
@@ -3079,7 +3077,14 @@
resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc"
integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==
"@types/react-dom@*", "@types/react-dom@17.0.14":
"@types/react-dom@*":
version "18.0.0"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.0.0.tgz#b13f8d098e4b0c45df4f1ed123833143b0c71141"
integrity sha512-49897Y0UiCGmxZqpC8Blrf6meL8QUla6eb+BBhn69dTXlmuOlzkfr7HHY/O8J25e1lTUMs+YYxSlVDAaGHCOLg==
dependencies:
"@types/react" "*"
"@types/react-dom@17.0.14":
version "17.0.14"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.14.tgz#c8f917156b652ddf807711f5becbd2ab018dea9f"
integrity sha512-H03xwEP1oXmSfl3iobtmQ/2dHF5aBHr8aUMwyGZya6OW45G+xtdzmq6HkncefiBt5JU8DVyaWl/nWZbjZCnzAQ==