diff --git a/site/package.json b/site/package.json
index 2bb3190269..3fb9337e63 100644
--- a/site/package.json
+++ b/site/package.json
@@ -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",
diff --git a/site/src/pages/login.test.tsx b/site/src/pages/login.test.tsx
index c770c4ce0b..8f1bcdeec1 100644
--- a/site/src/pages/login.test.tsx
+++ b/site/src/pages/login.test.tsx
@@ -23,31 +23,30 @@ describe("SignInPage", () => {
render()
// Then
- await screen.findByText(Language.signIn, { exact: false })
+ await screen.findByText(Language.signIn)
})
it("shows an error message if SignIn fails", async () => {
// Given
- render()
- // 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()
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")
diff --git a/site/yarn.lock b/site/yarn.lock
index c93ad3232a..17ee0ac68a 100644
--- a/site/yarn.lock
+++ b/site/yarn.lock
@@ -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==