Integration Tests — A Whole Feature — Concept Check
Questions on Integration Tests — A Whole Feature. Rendering a real route with real providers and walking through a flow catches the wiring bugs that unit tests structurally cannot, at a fraction of the cost of an E2E suite.
Questions in this quiz
7 questions on Integration Tests — A Whole Feature — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.You have written an integration test that covers form submission and navigation. After a recent refactor, the test fails because the form submits but the list does not refresh. What is likely the issue?
- AThe mutation succeeds but the invalidation is missing.
- BThe form validation is incorrect.
- CThe navigation guard is redirecting incorrectly.
- DThe test is running in the wrong environment.
2.In an integration test, a signed-out user is not redirected to the sign-in page when accessing a protected route. What could be the cause?
- AThe route is not protected by a guard.
- BThe auth provider is not correctly set up.
- CThe test is missing a network mock.
- DThe user session is still active.
3.An integration test for a React app is failing because it cannot find a heading that should appear after a successful form submission. Which of the following is a possible reason?
- AThe test is running with outdated fixtures.
- BThe test environment lacks a real browser.
- CThe form submission handler is broken.
- DThe heading is not rendered in the DOM.
4.Why are integration tests considered more valuable than unit tests for feature flows in React applications?
- AThey catch wiring bugs between components.
- BThey run faster than unit tests.
- CThey require no setup or providers.
- DThey cover all possible user interactions.
5.An integration test fails after a copy edit changes button text. What should be done to prevent such failures?
- ARun tests only after UI changes.
- BAvoid testing text content entirely.
- CUse role and accessible name assertions.
- DUse snapshot testing for text.
6.What is a common pitfall that can cause an integration test suite to become unreliable over time?
- ATests are too focused on unit-level details.
- BTests are written without a testing framework.
- CTests depend on shared mutable fixtures.
- DTests run in a real browser environment.
7.In a React integration test, a 404 page is not rendered for an unknown route. What might be wrong?
- AThe route is incorrectly guarded.
- BThe route configuration is missing a fallback.
- CThe test lacks proper network mocking.
- DThe test is not using a real router.