Skip to content

[FE-68] Establish component testing conventions with reference tests #1010

Description

@mftee

Overview

Once test discovery is fixed ([FE-65]), the frontend needs a pattern for contributors to follow. @testing-library/jest-dom is already referenced in the Jest setup, and the app uses next-intl with locale routing — so components need providers wrapped correctly or every test fails on a missing intl context.

Tasks

  • Add a renderWithProviders test utility wrapping components in NextIntlClientProvider with test messages, plus any auth or theme provider.
  • Confirm @testing-library/react and @testing-library/user-event are installed; add them if not.
  • Write reference tests for a form component and a data-display component, showing the intended pattern.
  • Establish the convention that tests assert user-visible behaviour rather than implementation details.
  • Document the pattern in frontend/README.md so contributors have a template.

Acceptance Criteria

  • Components render in tests with intl and other providers attached.
  • Reference tests exist for contributors to copy.
  • The conventions are documented.

Dependencies

Blocked by [FE-65].

Notes for Contributors

Comment below to be assigned.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions