Skip to content

Commit 828ca5a

Browse files
authored
Expand README for src/fixtures (#58898)
1 parent ae191c7 commit 828ca5a

1 file changed

Lines changed: 64 additions & 0 deletions

File tree

src/fixtures/README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,67 @@ Optionally, also set `DEBUG_MIDDLEWARE_TESTS` variable to get stacktraces for `5
103103
```shell
104104
DEBUG_MIDDLEWARE_TESTS=true ROOT=src/fixtures/fixtures TRANSLATIONS_FIXTURE_ROOT=src/fixtures/fixtures/translations vitest src/fixtures/tests
105105
```
106+
107+
## Fixture Dependencies by Subject
108+
109+
Which subjects rely on which fixtures:
110+
111+
| Subject | Fixtures Used | Purpose |
112+
|---------|---------------|---------|
113+
| `src/content-render` | Liquid tags, Markdown files | Test custom tags and rendering |
114+
| `src/versions` | Version frontmatter | Test version conditionals |
115+
| `src/redirects` | Redirect frontmatter | Test redirect logic |
116+
| `src/search` | Search index content | Test search functionality |
117+
| `src/landings` | Landing page layouts | Test landing page rendering |
118+
| `src/rest` | REST API fixtures | Test REST docs rendering |
119+
| `src/graphql` | GraphQL schema fixtures | Test GraphQL docs rendering |
120+
| `src/webhooks` | Webhook fixtures | Test webhook docs rendering |
121+
122+
### Adding fixtures for new subjects
123+
124+
When adding new functionality:
125+
1. Create minimal content in `src/fixtures/fixtures/content/`
126+
2. Add any required data in `src/fixtures/fixtures/data/`
127+
3. Keep product names matching real content (top-level only)
128+
4. Run `./src/tests/scripts/copy-fixture-data.ts` to sync required files
129+
130+
## Ownership & Escalation
131+
132+
### Ownership
133+
- Team: Docs Engineering
134+
135+
### Escalation
136+
Fixture content is maintained by the team. If tests break due to fixture issues:
137+
1. Check if fixture content needs updating
138+
2. Run `./src/tests/scripts/copy-fixture-data.ts` to sync
139+
3. Ask in #docs-engineering if unclear
140+
141+
### Maintenance responsibilities
142+
- Keep fixtures minimal but functional
143+
- Update when adding new features
144+
- Don't let fixtures drift from real content structure
145+
- Document fixture-specific test patterns
146+
147+
## Related Documentation
148+
149+
- [Playwright tests](./PLAYWRIGHT.md) - Browser-based E2E tests
150+
- [Axe accessibility tests](./axe.md) - Accessibility testing with fixtures
151+
- [Test infrastructure](../tests/README.md) - Overall testing setup
152+
153+
## Known Limitations
154+
155+
### Fixture coverage
156+
- Not all subjects have comprehensive fixtures
157+
- Some complex scenarios may need real content for testing
158+
- Translation fixtures are minimal
159+
160+
### Maintenance burden
161+
- Fixtures need updates when content structure changes
162+
- Some data files must be kept in sync with real content
163+
- Product names must exactly match real content
164+
165+
### Best practices
166+
- Keep fixtures focused on one feature at a time
167+
- Don't replicate entire content structure unnecessarily
168+
- Use fixtures for functionality tests, not content validation
169+
- Update fixtures when breaking changes occur

0 commit comments

Comments
 (0)