Unit tests verify individual functions in isolation; they cannot catch bugs that only appear when multiple units interact — a misconfigured middleware, a mismatched API contract between frontend and backend, or an authentication check that passes locally but fails in a real browser session. ISO 25010:2011 §6.5.5 requires verification at the workflow level. For user-facing applications, the most costly bugs are the ones that break the critical path — signup, login, checkout — while all the unit tests are green.
Medium because without integration tests, the most visible user-facing workflows — auth, data submission, core product actions — have no automated verification that they work end-to-end.
Start with the most important user journey. For a web app with authentication, a Playwright test covers the full stack in one shot:
// tests/auth-flow.test.ts
import { test, expect } from '@playwright/test'
test('user can sign in and access dashboard', async ({ page }) => {
await page.goto('/login')
await page.fill('[name=email]', 'test@example.com')
await page.fill('[name=password]', 'testpassword')
await page.click('[type=submit]')
await expect(page).toHaveURL('/dashboard')
await expect(page.locator('h1')).toContainText('Welcome')
})
For API routes, use supertest or route-handler integration tests. Aim for at least three workflow-level tests covering: authentication, primary data submission, and the application's core action.
ID: code-quality-essentials.testing.integration-tests
Severity: medium
What to look for: Look for tests that exercise multiple units together or simulate real user flows. These are typically found in files using Playwright (@playwright/test), Cypress, or integration-mode test files using supertest (for API routes) or @testing-library/react with render+interaction+assertion chains. A critical workflow test verifies: a user can complete an end-to-end path (e.g., "submit a form and see the success state"), or an API handler receives input, processes it, and returns a correct response. Unit tests that mock every dependency don't count as integration tests. Look for at least three workflow-level tests covering the application's primary value paths: authentication, data submission, and the main feature.
Pass criteria: Enumerate all relevant code locations. At least three integration or E2E tests covering distinct critical workflows (e.g., auth flow, data submission, payment or core action). Setup for running these tests is documented with at least 1 verified location.
Fail criteria: All tests are isolated unit tests, or no tests exist, or integration tests cover only one workflow.
Skip (N/A) when: No test files exist (covered by earlier check).
Detail on fail: "No integration or E2E tests found; only isolated unit tests present; critical user flows are not automatically verified"
Remediation: Start with the most important user journey in your application. For a web app with auth:
// tests/auth-flow.test.ts (Playwright example)
import { test, expect } from '@playwright/test'
test('user can sign in and access dashboard', async ({ page }) => {
await page.goto('/login')
await page.fill('[name=email]', 'test@example.com')
await page.fill('[name=password]', 'testpassword')
await page.click('[type=submit]')
await expect(page).toHaveURL('/dashboard')
await expect(page.locator('h1')).toContainText('Welcome')
})
For API routes, use supertest or Next.js route handlers with mock requests. Document setup in README.md.