Skip to content

Task 4.10: Create Test Data Fixture for Reproducible Testing #37

@rowantervelde

Description

@rowantervelde

Epic: #11 (Epic 4: Edge Cases, Performance & Testing)
Type: Task
Priority: P1 (High)
Estimate: 0.5 day

Description

Create standardized test data fixture covering all edge cases to enable reproducible testing across unit, E2E, and manual tests.

Acceptance Criteria

  • JSON fixture with 50+ articles covering all scenarios
  • Include edge cases from testplan (TC-17):
    • 100+ articles (pagination)
    • Articles with missing titles/URLs
    • Extreme sentiment scores (0.99, -0.99)
    • Very long titles (>200 chars)
    • Unicode characters in titles
    • Duplicate articles
  • Fixture includes metadata: timestamp, source distribution
  • Load fixture in dev mode via /api/test/load-fixture endpoint
  • Document fixture usage in README

Technical Notes

  • Create tests/fixtures/sentiment-detail.json
  • Structure: match /api/sentiment response format
  • Include all 3 moods: positive, neutral, negative
  • Add test helper: loadTestFixture() function
  • Consider date ranges: ensure timestamps are recent
  • Optionally: seed fixture into Netlify Blobs for E2E tests

Dependencies

  • Blocks: Task 4.7 (Unit tests), Task 4.8 (E2E tests)
  • Blocked by: None (can work in parallel)

Test Coverage

  • Used by all test suites
  • Manual testing with consistent data

Related Files

  • tests/fixtures/sentiment-detail.json
  • server/api/test/load-fixture.ts (optional dev endpoint)
  • specs/004-sentiment-detail/testplan.md

Part of Feature 004: Sentiment Detail Breakdown Page

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions