Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
13 changes: 6 additions & 7 deletions site/src/pages/login.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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, "[email protected]")
userEvent.type(password, "password")
await userEvent.type(email, "[email protected]")
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")
Expand Down
25 changes: 15 additions & 10 deletions site/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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/[email protected]":
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"
Expand Down Expand Up @@ -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/[email protected]":
"@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/[email protected]":
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==
Expand Down