Skip to content

fix(test): line the test steps text header up with its columns - #714

Merged
zeshi-du merged 2 commits into
TestSprite:mainfrom
lidxgoesgiri:fix/steps-header-alignment
Nov 10, 2026
Merged

zeshi-du merged 2 commits into
TestSprite:mainfrom
lidxgoesgiri:fix/steps-header-alignment

Conversation

@lidxgoesgiri

@lidxgoesgiri lidxgoesgiri commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

test steps in text mode printed every heading two columns left of its values. renderStepsText built the header as pad(' ', 2) + pad('INDEX', …) + ' ' + …, gluing the marker column onto INDEX, while each row is [marker, index, …].join(' '). The header now uses the same join(' ') as the rows, marker column included.

Before / after (testsprite --dry-run test steps t1):

  INDEX  ACTION  STATUS  DESCRIPTION                        UPDATED
    4      click   passed  Click the cart icon                2026-05-05T12:34:56.000Z
    INDEX  ACTION  STATUS  DESCRIPTION                        UPDATED
    4      click   passed  Click the cart icon                2026-05-05T12:34:56.000Z

Rows, the error: continuation line and --output json are unchanged.

Related issue

Closes #687

Season 4 CLI Improvement Bonus

  • I'm entering this PR for the Season 4 CLI Improvement Bonus

Discord username: idabagus10

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behavior)
  • Documentation only
  • Build / CI / chore

Checklist

  • PR targets the main branch.
  • Commits follow Conventional Commits (feat(...), fix(...), docs(...), …).
  • npm run lint and npm run format:check pass.
  • npm run typecheck passes.
  • npm test passes and coverage stays at or above the 80% gate.
  • New behavior is covered by unit tests (mock-based; no network or credentials required).
  • No secrets, API keys, internal endpoints, or personal data are included.
  • User-facing changes are reflected in README.md / DOCUMENTATION.md where relevant.

Notes for reviewers

Summary by CodeRabbit

  • Tests
    • Added coverage to verify that text-mode step details align beneath their headers for both passed and failed rows.
  • Refactor
    • Updated how the text-mode table header is assembled; its displayed formatting remains unchanged.

The header glued the two-character failure-marker column straight onto
INDEX, while each row joins the marker as its own cell with a two-space
gap, so every heading sat two columns left of its values. Build the
header with the same join as the rows. Rows, the error: continuation
line and --output json are unchanged.

Closes TestSprite#687
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The test steps text header now uses the same two-space separator as the rows. A new test checks column alignment for normal and failure-contributing rows.

Changes

Test steps text table alignment

Layer / File(s) Summary
Align header columns with row values
src/commands/test.ts, src/commands/test.test.ts
renderStepsText builds the header with the same separator used for rows. The test checks that header and value positions align, including for a row marked with * .

Estimated code review effort: 1 (Trivial) | ~5 minutes

Severity of issue fixed: Low

Merge Risk: Minimal · up to 726ae

The change aligns the headings with their values. No material merge-blocking risk was identified.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: aligning the test steps text header with its columns.
Linked Issues check Passed Issue #687 requires test steps text headings to align with row values while leaving rows and JSON output unchanged. renderStepsText now builds the header from the same column segments and `join(' …
Out of Scope Changes check Passed The whole-PR diff contains only the renderStepsText header fix and a test for the alignment required by #687. Both changes support the linked issue. No unrelated changes appear in the diff.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Linked Issues check

Explanation

Issue #687 requires test steps text headings to align with row values while leaving rows and JSON output unchanged. renderStepsText now builds the header from the same column segments and join(' ') separator as the rows. The new test checks heading offsets for passed and failure-marked rows. The diff does not change row construction or JSON output.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files. (1 skipped: 1 too large.)

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 872a062 and 726ae6c.

Files selected for processing: 2

  • src/commands/test.test.ts
  • src/commands/test.ts
Files skipped from review as they are similar to previous changes: 1

  • src/commands/test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@zeshi-du
zeshi-du merged commit dddb33a into TestSprite:main Nov 10, 2026
26 checks passed
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.

[Hackathon] fix(test): the test steps text table prints every header two columns left of its values

2 participants