From 035291804e94b3fc63774dd352d90b5d2088c460 Mon Sep 17 00:00:00 2001 From: Alex Carpenter Date: Mon, 5 Oct 2026 16:03:04 -0400 Subject: [PATCH] docs(repo): colocate Mosaic feature tests with their component --- .changeset/mosaic-colocate-feature-tests.md | 2 ++ .claude/skills/mosaic/references/testing.md | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 .changeset/mosaic-colocate-feature-tests.md diff --git a/.changeset/mosaic-colocate-feature-tests.md b/.changeset/mosaic-colocate-feature-tests.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/mosaic-colocate-feature-tests.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.claude/skills/mosaic/references/testing.md b/.claude/skills/mosaic/references/testing.md index 9431c18a6ac..d26bc1b567a 100644 --- a/.claude/skills/mosaic/references/testing.md +++ b/.claude/skills/mosaic/references/testing.md @@ -100,6 +100,14 @@ it('makes the selected organization active and closes', async () => { `packages/mosaic/src/features/user-button/__tests__/user-button.feature.test.tsx` is the worked example. +Put a feature test next to the component it renders, and name it after that +component. `` is tested by +`user-profile-password-section/user-profile-password-section.feature.test.tsx`. +Vitest finds feature tests by the `.feature.test.tsx` suffix, so a shared +`__tests__/` folder buys nothing and makes a section's tests harder to find. +Existing tests in `__tests__/` folders, the worked example included, move when +their feature next changes. + ### The toolkit (`src/__tests__/feature/`) - **`fapi.ts`**: typed builders for FAPI JSON (`fapiEnvironment`, `fapiUser`,