chore: MultiCombobox の E2E テストを単体テストで書き直す #5021
Open
+300
−321
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
関連URL
概要
MultiComboBox コンポーネントには E2E テストがありますが、基本的には単体テストで十分なテストであるため、単体テスト(testing-library) に移植します。
これによって、 CI で時間がかかっている E2E テストのコスト削減及び、暗黙に発生している Storybook への依存の削減、自動テスト全体のポリシー整備を行います。
変更内容
やらなかったこと
現行のE2Eテストにある以下のテストシナリオは単体テストで再現できませんでした。JSDOM に IntersectionObserver が実装されていないためです。
最初の調査で見逃してしまってて恐縮なんですが、これのために testcafe を残すというのもつらいので、本PRにおいてはなくなく削除してます。Playwright による新しい E2E があるので、そちらで改めて対応すべきかは別途検討します。
確認方法
テストコードのみなのでCIが通ればOKです。
備考
基本的には以下の SingleCombobox のときのコピペをベースにしてます。