Skip to content

test(tui): cover repository table header - #73

Open
be-student wants to merge 2 commits into
mabd-dev:mainfrom
be-student:codex/63-repostableheader-coverage
Open

test(tui): cover repository table header#73
be-student wants to merge 2 commits into
mabd-dev:mainfrom
be-student:codex/63-repostableheader-coverage

Conversation

@be-student

@be-student be-student commented Sep 6, 2026

Copy link
Copy Markdown

Addresses part of #63.

Adds behavioral coverage for repository counts, stash-aware dirty counts, and rendered header content. Package statement coverage increases from 0% to 100%.

Validation: go test -race ./..., go vet ./..., and go build ./....

AI use: I used OpenAI Codex to help write the tests, then reviewed them and ran the checks above.

Greptile Summary

The new header test verifies component output, but the main TUI layout does not render that component. The header text therefore remains invisible to users. This is a non-blocking concern and does not make the change unsafe to merge.

Confidence Score: 4/5

Safe to merge with a non-blocking test-coverage gap: the production TUI still omits the repository-table header.

One confirmed non-blocking concern remains. The rendered production model was exercised and did not include the configured header text.

Files Needing Attention: internal/render/tui/repostableheader/reposTableHeader_test.go needs a production-composition assertion; internal/render/tui/view.go omits the initialized header from the layout.

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex produced proof for a posted P2 finding and referenced the corresponding review comment for details.
  • T-Rex produced proof for another posted P2 finding, with the review comment details available.
  • General contract validation showed that Before: TestHeaderViewIncludesApplicationNameAndRepositoryCount passed while exercising Header.View, and After: TestProductionViewOmitsConfiguredReposTableHeader passed while exercising Model.View; the authored focused test and its runnable command were uploaded alongside both command outputs.
  • Artifacts were attached to support the proofs, including code, shell scripts, and logs for proofs 0 and 2.

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (1)

  1. General comment

    P2 Repository table header is initialized but omitted from the production TUI view

    • Bug
      • Users never see the reposcan • N repos header, despite Render() constructing and storing it in Model.rtHeader. The PR test at internal/render/tui/repostableheader/reposTableHeader_test.go:43 only tests the isolated component and therefore cannot establish visible production behavior.
    • Cause
      • internal/render/tui/view.go:34-40 joins reposTable, reposDetails, and footer without rendering or joining m.rtHeader.View().
    • Fix
      • Render m.rtHeader.View() in Model.View() and include it in the vertical layout; adjust available body/table height as needed. Add a production-composition regression test asserting the configured header text occurs in Model.View().Content.

    T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "test(tui): cover repository table header" | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Context used:

header := Header{}
header.SetReport(report.ScanReport{RepoStates: make([]report.RepoState, 2)}, false)

view := header.View()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Header Test Misses Composition

This test verifies the header component in isolation, but the production TUI view combines only the repository table, details, and footer; it never includes the initialized repository header. The test therefore passes while users cannot see reposcan • N repos. Add a regression assertion through the production model view after wiring the header into that layout. This is non-blocking, but the current test does not protect the user-visible behavior.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Artifacts

Evidence from the check

  • Temporary Go test constructs the production TUI model with a populated repository header and asserts the rendered model omits that header, establishing the composition gap.

Evidence from the check

  • Shell command copies the temporary focused test into the TUI package, runs it, and removes the copied test afterward, providing a repeatable production-path check.

Command output from the check

  • Executed the PR's direct header-view test successfully, showing the limited isolated behavior it covers.

Command output from the check

  • Executed the focused production `Model.View()` test successfully; it shows the isolated header text exists but both header strings are absent from the production view.

View artifacts

T-Rex Ran code and verified through T-Rex

@mabd-dev

mabd-dev commented Sep 6, 2026

Copy link
Copy Markdown
Owner

thanks for your time and contributing to this project 🚀
kindly follow the PR template

@mabd-dev

mabd-dev commented Sep 7, 2026

Copy link
Copy Markdown
Owner

@be-student template look like this. Please update PR description with this and fill relevant data

Pull Request

Description

Changes Made

Testing

  • Tested locally with example workflows
  • Added new tests (if applicable)
  • Tested with different filters, output, etc...

Screenshots (if applicable)

Checklist

  • I have starred the repository
  • My code follows the project's code style
  • I have updated the documentation (README, cli-flags, etc...)
  • My changes generate no new warnings
  • I have tested my changes in a real workflow
  • All tests pass locally

Additional Notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants