Component Test
コンポーネントテスト
コンポーネントテストは、インターフェースの一部を実際のレンダリングスペースに配置します。その部品に制御された入力とデータを渡し、動作を確認します。
もう一つの例
デザインシステムのエンジニアは、200の選択肢とエラー状態を持つコンボボックスを開きます。キーボードでの選択は、値とそのアクセシブルステータスを変更する必要があります。静止コンテンツのスクリーンショットでは、この動作をテストできません。
主な部分
- 01ストーリーフィクスチャ
- 02マウントされたコンポーネント
- 03ブラウザアサーション
以下の場合に使用します
UIの動作がブラウザのレンダリングを必要とするが、製品全体の体験は必要としない場合にこの用語を使用します。
以下の場合は使用しないでください
そのコンポーネント外の接続に対する統合テストやE2Eテストの代わりにコンポーネントテストを使用しないでください。
コードで使用する名前
story fixture → mount → user action → assertion 出荷前に
Check the environment and prepared test data (fixture). Define a result you can observe, failure and edge cases, isolation, stable inputs, useful error details, and cleanup. Set a time budget, owner, and flaky-test rule.
Outcome:Complete the task with コンポーネントテスト (Component Test)。 User context:デザインシステムのエンジニアは、200の選択肢とエラー状態を持つコンボボックスを開きます。キーボードでの選択は、値とそのアクセシブルステータスを変更する必要があります。静止コンテンツのスクリーンショットでは、この動作をテストできません。 Validation approach:コンポーネントテスト (Component Test)。 Why it fits:UIの動作がブラウザのレンダリングを必要とするが、製品全体の体験は必要としない場合にこの用語を使用します。 Do not use it when:そのコンポーネント外の接続に対する統合テストやE2Eテストの代わりにコンポーネントテストを使用しないでください。 Test requirements: Name the system and test environment. Define prepared test data, other inputs, and the result you can observe. Include failure and edge cases, allowed error, isolation, and cleanup. Test operations: Make failures easy to diagnose. Control random or changing inputs. Name an owner. Keep the test fast and simple enough for its release gate. Acceptance criteria: The test fails for the known bug and passes after the fix. It repeats in the target environment, gives useful evidence, and does not expose or change unrelated data. Evidence and limits (evidence boundary):その情報源にとって公式です。他のプラットフォームやチームはその用語を別の方法で使用する場合があります。 Unknowns to confirm: Release gate, environment, prepared test data, allowed error, time budget, owner, and flaky-test rule.
このリクエストを確認する
Review how コンポーネントテスト (Component Test) is used now. Definition: コンポーネントテストは、インターフェースの一部を実際のレンダリングスペースに配置します。その部品に制御された入力とデータを渡し、動作を確認します。 Release checks: Check the environment and prepared test data (fixture). Define a result you can observe, failure and edge cases, isolation, stable inputs, useful error details, and cleanup. Set a time budget, owner, and flaky-test rule. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.