Skip to content

7.3: Write Integration Tests #101

@justin808

Description

@justin808

Overview

Create comprehensive integration test suite.

Parent Epic: #70
Priority: P1

Prerequisites

Next Issues (after this is complete)

  • 7.4: Add Production Configuration (ensure tests pass in CI)

Acceptance Criteria

  • System tests for story list page (all types: top, new, show, ask, jobs)
  • System tests for pagination
  • System tests for story detail page
  • System tests for comment display
  • System tests for user profile page
  • System tests for error states (404, etc.)
  • Tests verify RSC streaming works
  • All tests passing locally
  • CI configuration for running tests

Implementation Notes

Use Capybara with a JavaScript driver for full RSC testing:

# spec/system/stories_spec.rb
require 'rails_helper'

RSpec.describe 'Stories', type: :system do
  it 'displays top stories' do
    visit '/news/1'
    expect(page).to have_css('.story', minimum: 1)
  end
  
  it 'paginates correctly' do
    visit '/news/1'
    click_link 'More'
    expect(page).to have_current_path('/news/2')
  end
end

Consider mocking the HN API for reliable, fast tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    HN-RSCHacker News RSC DemoRSCReact Server Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions