RS-21803: Spacer Col test - #67
Open
SurreyHughesDisplayr wants to merge 2 commits into
Open
Conversation
…ol.header.fill CSS Adds coverage for CreateCustomTable's spacer.col/col.header.fill column-header behaviour, including the show.row.headers index shift, the show.col.headers suppression path, and the confirmed out-of-range spacer.col defect where sprintf emits a literal class="NA" header cell. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- comment the load-bearing narrowing from bare <th to <th class=" - pin exact colheaderdefault th strings instead of loose substring probes - assert the 6-th-cell recycling consequence of the out-of-range spacer.col - document why spacer.col = 3 (not 2) is required for the label-survival test Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds unit test coverage for the
spacer.colargument ofCreateCustomTable(R/createcustomtable.R).class="spacer"header cell and the.spacer { … }CSS block, including theuse.predefined.cssvariant.show.row.headers = TRUEthe spacer lands one column later than with it off, verified by pinning the full<th …>strings on both sides.colheaderdefault1, pinned as exact strings.col.header.fillgenuinely displacesbackground: transparent, so the two CSS assertions discriminate rather than coincide.Pinned production bug
One test deliberately pins current buggy behaviour. For an out-of-range
spacer.col,col.header.styles[spacer.col] <- "spacer"silently extends the vector withNA_character_, andsprintfthen emits literalclass="NA"header cells. Becausesprintfrecycles, the header row also emits 6<th>for a 3-column header, re-emitting labelsXandY. Both consequences are asserted, so the test fails loudly when the defect is fixed. No production code is changed in this PR, and no defect ticket is filed for it yet.Note the test plan's own example for this scenario (
spacer.col = 10on the 4-cell header) does not reach the defect — it errors insprintfwith "arguments cannot be recycled to the same length".spacer.col = 6on a 3-column header reaches the sameNA-extension branch cleanly, and is what the test uses.Jira: https://numbers.atlassian.net/browse/RS-21803
Stacked PR
Based on
RS-21803-sigleadercircles(#66), notmaster— both plans add tests totests/testthat/test-createcustomtable.Rand share itstableHtml/normWs/countOccurrenceshelpers. Please merge #66 first. The diff shown against that base is this plan's work only.Test plan
69 passing, 0 failures (22
test_thatblocks; 11 added here).🤖 Generated with Claude Code