Skip to content
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

Merged
merged 10 commits into from
Jul 22, 2022
Merged

env: update dependencies #1221

merged 10 commits into from
Jul 22, 2022

Conversation

lja1018
Copy link
Contributor

@lja1018 lja1018 commented Jul 21, 2022

Please check if the PR fulfills these requirements

  • It's the right issue type on the title
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • It does not introduce a breaking change or has a description of the breaking change

Description

  • update dependencies
  • checklist
    • types
    • jest test
    • playwright test
    • storybook
    • build

Thank you for your contribution to TOAST UI product. ๐ŸŽ‰ ๐Ÿ˜˜ โœจ

* `@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);
Copy link
Contributor Author

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๋กœ ๋Œ€์ฒดํ•ด๋„ ํ…Œ์ŠคํŠธ๊ฐ€ ํ†ต๊ณผํ•˜์—ฌ ๋Œ€์ฒด ํ›„ ์ข…์†์„ฑ ์ œ๊ฑฐํ–ˆ์Šต๋‹ˆ๋‹ค.

Copy link
Contributor

@adhrinae adhrinae Jul 21, 2022

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

Copy link
Contributor Author

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",
Copy link
Contributor Author

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
Comment on lines 110 to 112
'jest/expect-expect': 'off',
'jest/no-done-callback': 'off',
'jest/no-standalone-expect': ['error', { additionalTestBlockFunctions: ['test'] }],
Copy link
Contributor

@adhrinae adhrinae Jul 21, 2022

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 ์ ์šฉํ•ด๋ณผ ์ˆ˜ ์žˆ์„๊นŒ์š”?
ํ•œ๋ฒˆ ํ•ด ๋ณด์‹œ๊ณ  ์˜ค๋ž˜ ๊ฑธ๋ฆฐ๋‹ค๋ฉด ์ด๋Œ€๋กœ ๋‘์…”๋„ ๋ผ์š”.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋„ต ํ•œ๋ฒˆ ์ ์šฉํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค

@lja1018 lja1018 merged commit a1e6596 into main Jul 22, 2022
@lja1018 lja1018 deleted the env/update-dependencies branch July 22, 2022 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants