-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
env: update dependencies #1221
env: update dependencies #1221
Conversation
* `@testing-library/preact-hooks` integrate into `@testing-library/preact` * remove `@testing-library/user-event`
@@ -125,7 +123,7 @@ describe('useTimeGridEventMove', () => { | |||
const event = screen.getByText('Event 1'); | |||
|
|||
// When | |||
userEvent.click(event); | |||
fireEvent.click(event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@testing-library/user-event
๋ ์ฌ๊ธฐ์์๋ง ์ฐ์ด๋ฉฐ fireEvent
๋ก ๋์ฒดํด๋ ํ
์คํธ๊ฐ ํต๊ณผํ์ฌ ๋์ฒด ํ ์ข
์์ฑ ์ ๊ฑฐํ์ต๋๋ค.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user-event
์ click
์ ์ค์ ๋ธ๋ผ์ฐ์ ์์ ํด๋ฆญํ์ ๋๋ ๋์ผํ๊ฒ ์ด๋ฒคํธ๋ฅผ ๋ณตํฉ์ ์ผ๋ก ์คํํฉ๋๋ค.
fireEvent
์ click
์ ๋ฑ click
์ด๋ฒคํธ๋ง ์คํ์ํค์ฃ . ์ ํ
์คํธ์์ fireEvent.click
์ด๋ฉด ์ค์ง์ ์ผ๋ก ํ
์ ์๋ฌด๋ฐ ์ด๋ฒคํธ๋ ์
๋ ฅ๋์ง ์์ ๊ฒ์ด๋ผ ๋น์ฐํ ํต๊ณผํฉ๋๋ค.
๊ทธ๋์ user-event
๋ฅผ ์จ์๋๋ฐ... ์ต๊ทผ์ ์๋์ ๋ค๋ฅด๊ฒ ์คํจํ๋ ์ผ์ด ์์ด fireEvent.mouseDown
+ fireEvent.mouseUp
์ ์ง์ ํธ์ถํด์ผ ํ
์คํธ๊ฐ ํต๊ณผํ๋ ๊ฒฝ์ฐ๊ฐ ์ฆ๋๋ผ๊ณ ์. ๊ทธ๋์ ๋ง์ด ์๋จ์์ ์ด๋ ๊ฒ ๋ ๊ฒ ๊ฐ์ต๋๋ค.
๊ฐ๊ธ์ ์ด๋ฉด user-event
๋ ๊ทธ๋๋ก ํ์ฉ๋์์ผ๋ฉด ์ข๊ฒ ๋ค๊ณ ์๊ฐํด์.
์ต์ ๋ฒ์ ๊ธฐ์ค์ผ๋ก๋ userEvent.setup()
์ผ๋ก ์์์ ์ฌ์ฉ์ ์ธ์คํด์ค๋ฅผ ๋ง๋ ๋ค์ ํ์ฉํ๋ ๊ฒ ๊ฐ๊ตฐ์. ํ ๋ฒ ์๋ํด๋ณด์๊ณ ๋ณ๋ก ํจ๊ณผ ์์ผ๋ฉด ์ ๊ฑฐํด์ฃผ์ธ์. ๊ทธ๋ฆฌ๊ณ ์ด ํจํค์ง๋ @src/test/utils
์์ import ๋๋๋ก ํด ์ฃผ์๋ฉด ๋๊ฒ ๋ค์.
https://testing-library.com/docs/user-event/intro/#writing-tests-with-userevent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ค์ ์ค์นํ๊ณ ์ ์ฉํ์ต๋๋ค.
๊ธฐ์กด์ ์ฌ์ฉํ๋ ๊ณณ์ 2๊ณณ ๋ฐ๊ฒฌํ๊ณ setup
ํ click
๊ณผ userEvent.click
๋ ๋ชจ๋ ์๋ํ๋๋ฐ ์ฌ์ ํ ์คํจํ๊ณ ์์ด mouseDown+mouseUp
๊ทธ๋๋ก ๋ณ๊ฒฝ์์ด ๋์์ต๋๋ค.
"@rollup/plugin-commonjs": "^22.0.1", | ||
"@testing-library/jest-dom": "^5.16.4", | ||
"@testing-library/preact": "^2.0.1", | ||
"@testing-library/preact-hooks": "^1.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@testing-library/preact-hooks
์ renderHook
์ด @testing-library/preact
์ ํฌํจ๋์ด ์ ๊ฑฐ.
.eslintrc.js
Outdated
'jest/expect-expect': 'off', | ||
'jest/no-done-callback': 'off', | ||
'jest/no-standalone-expect': ['error', { additionalTestBlockFunctions: ['test'] }], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด๊ฑธ ๋ณด๋๊น '์ด์ฐจํผ ์ด๊ฑด Jest ๋ฃฐ์ ์ ์ฉ์ ๋ค ๋นผ๋ฒ๋ ค์ผ ๊ฒ ๋๋ฐ, ๊ทธ๋ฌ๋ฉด Playwright์ฉ ๋ฃฐ์ ์์๊น?' ํ๊ณ ์ฐพ์๋ณด๋ ์๋๋ผ๊ณ ์.
https://www.npmjs.com/package/eslint-plugin-playwright
์์ ํ์ผ๋ง Jest ํ๋ฌ๊ทธ์ธ ์ ์ธ๋๋๋ก ์ค๋ฒ๋ผ์ด๋ ํ ๋ค์ Playwright ์ ์ฉํด๋ณผ ์ ์์๊น์?
ํ๋ฒ ํด ๋ณด์๊ณ ์ค๋ ๊ฑธ๋ฆฐ๋ค๋ฉด ์ด๋๋ก ๋์
๋ ๋ผ์.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ต ํ๋ฒ ์ ์ฉํด๋ณด๊ฒ ์ต๋๋ค
* split jest and playwright eslint rules
Please check if the PR fulfills these requirements
fix #xxx[,#xxx]
, where "xxx" is the issue number)Description
Thank you for your contribution to TOAST UI product. ๐ ๐ โจ