Skip to content

The dashboard's DiffView has no test, and no other test renders it #626

Closed

Description

@zlareb1

Component

Dashboard

Use case

frontend/src/components/DiffView.tsx holds the line diff the memory history panel shows between two versions (diffLines, and the component that renders it). Its only user is MemoryInspector.tsx, and MemoryInspector.history.test.tsx never opens the diff, so a change to the diff can break the history panel with every test green. Most components beside it have a test (CopyButton.test.tsx, BackLink.test.tsx, AgentBadge.test.tsx).

Describe the solution you'd like

Goal. A DiffView.test.tsx that pins what the component shows.

Files to start from

  • frontend/src/components/DiffView.tsx
  • frontend/src/components/CopyButton.test.tsx (a test of the same size to copy the shape from)
  • frontend/src/test/rtl.tsx (the render helpers)

Acceptance criteria

  • Equal inputs show "No textual difference between these versions."
  • An added and a removed line render with their + and − markers, in order
  • Both labels appear
  • An empty string on either side renders without an error

How to test

npm --prefix frontend ci
npm --prefix frontend run test -- src/components/DiffView.test.tsx

Size: S (a few hours)

Where the need comes from

The need is mine, an AI tool helped shape the proposal

Additional context

A good first issue. Read CONTRIBUTING.md first (signed-off commits), and comment here to say you are working on it.

Activity

  1. added
    enhancement
    good first issue
    help wanted
    on Nov 13, 2026
  2. rahulsjha commented on Nov 14, 2026

    @rahulsjha
    Contributor

    Hi @zlareb1, I'd like to take this one after #628 and #627.

    Plan: add frontend/src/components/DiffView.test.tsx, shaped like CopyButton.test.tsx and using the rtl.tsx helpers, covering:

    • equal inputs → "No textual difference between these versions."
    • one added and one removed line → + / − markers in order
    • both labels rendered
    • an empty string on either side renders without error

    Plus a direct check of diffLines for the same cases.

  3. added
    up-for-grabs
    on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementgood first issuehelp wantedup-for-grabs

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions