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

chore: Calendar コンポーネントの E2E テストを単体テストで書き直す #4954

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

s-sasaki-0529
Copy link
Contributor

関連URL

概要

Calendar コンポーネントには E2E テストがありますが、単体テストで十分なテストであるため、単体テスト(testing-library) に移植します。

これによって、 CI で時間がかかっている E2E テストのコスト削減及び、暗黙に発生している Storybook への依存の削減、自動テスト全体のポリシー整備を行います。

変更内容

  • E2E テスト側を削除
  • 同程度の内容の単体テストを実装

確認方法

テストコードのみなのでCIが通ればOKです。

備考

基本的にはすべての E2E テストを移植し、E2Eテスト基盤ごと一度削除し、Next.js を使用すると行った本質的に E2E テストが向いている場面用に作り直します。

今後は複数コンポーネントまとめてPRを出しますが、まずは1つ目ということで、こういうことをやるよという共有も含めて単体でPRを出しました。

@s-sasaki-0529 s-sasaki-0529 self-assigned this Sep 25, 2024
Copy link

pkg-pr-new bot commented Sep 25, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/kufu/smarthr-ui@4954

commit: 8060d08


import { Calendar } from './Calendar'

describe('Calendar', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

せっかくの単体テストなんで、もっと from/to みたいな他の props の振る舞いとかもテストしても良いんですが、今回は E2E テストの廃止を目的としてるので、E2Eテストで書かれている観点の移植に集中してます。

@s-sasaki-0529 s-sasaki-0529 marked this pull request as ready for review September 25, 2024 04:57
@s-sasaki-0529 s-sasaki-0529 requested a review from a team as a code owner September 25, 2024 04:57
@s-sasaki-0529 s-sasaki-0529 requested review from moshisora and nabeliwo and removed request for a team September 25, 2024 04:57
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.

1 participant