# Consolidate duplicated fixtures into one factory

The same test object built by hand in twenty files, replaced with one factory the suite shares.

Category: Test coverage and flaky tests
Source: https://letsship.ai/use-cases/consolidate-duplicated-fixtures
Published: 2026-08-25

## Goal

Replace hand-built duplicate fixtures with a single factory and migrate every test that used them.

## Acceptance criteria

- One factory covers every current variation, with overrides for the differences
- Every test that built the object by hand now uses it
- All touched tests still pass unchanged in what they assert
- The factory lives with the test helpers, not inside one suite

## What lands as proof

The deleted duplication in the diff, and every migrated suite still passing without a changed assertion.

## Prompt

Copy this to an agent to open the ticket:

```text
Create a Linear issue in my team and assign it to the SHIP agent.

Title: Move duplicated {entity} fixtures into one factory

Description: Replace hand-built duplicate fixtures with a single factory and migrate every test that used them.

Acceptance criteria:
- One factory covers every current variation, with overrides for the differences
- Every test that built the object by hand now uses it
- All touched tests still pass unchanged in what they assert
- The factory lives with the test helpers, not inside one suite

Before you create the issue, find an object constructed by hand in several test files in this repository and replace {entity} with it.
```

## Questions

### What does the agent actually change?

The ticket is scoped to one outcome: replace hand-built duplicate fixtures with a single factory and migrate every test that used them. Work that serves that outcome is in scope, and anything outside it is left for a separate ticket, so the pull request stays reviewable.

### How do I know the work is done?

The pull request carries the evidence, not only the diff. Here that means every touched test still passes, the duplicates are gone, so a reviewer can confirm the result without reproducing the work locally.

### How much oversight does this need?

None is required before the run starts. Every claim this ticket makes can be checked by machine, so the agent works straight through and a person reviews the finished pull request like any other.
