RS-21803: Col Widths and Custom CSS test - #71
Open
SurreyHughesDisplayr wants to merge 2 commits into
Open
Conversation
Add 15 test_that blocks covering col.widths tag emission (single, comma-separated, vector, NULL, rownames-dependent default, mismatched lengths), col.widths.fill.container's calc() table width, custom.css reaching the emitted HTML, the override.borders substring heuristic across celldefault/colheaderdefault/rowheaderdefault, and the boxIframeless vs Box widget-host selection driven by custom.css and scrolling. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Genuinely exercise surplus col.widths, pin expected tag vectors instead of vacuous equality checks, add a case that pins the override.borders unanchored-substring heuristic, remove a redundant default-valued block, use a distinct row.header.border.color, add missing expect_length guards, and fix a stale column-count comment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
col.widthsand custom CSS inCreateCustomTable(R/createcustomtable.R) — 14 test blocks.<col>tags exactly, including the literal surrounding spaces thatpaste(..., sep = " ")produces:<col width=' 200px '>. Percentage widths are pinned as an explicit vector so the assertion fails ifcol.widthsis ignored and the default25%is emitted instead.col.widthscounting the row-header column, fewer widths than columns, and more widths than columns (7 widths against a 5-column render, asserting the surplus is emitted untruncated).col.widths.fill.containeron and off, with the extracted<table>tag length-guarded so an empty match cannot pass vacuously.calc()table-width offset trackscell.border.width— pinned at a non-default5, verified to change with the argument rather than coming from elsewhere.boxIframeless(can-run-in-root-domset); any non-emptycustom.css, or arow.height, switches it to a plainBox.override.borders, including the case that pins its substring match as genuinely unanchored — an unrelated.x:nth-child(2)rule alongsideborder-topsuppresses the border. This is the argument's intended opt-out escape hatch, not a defect.Every argument under test uses a distinctive non-default value, so no assertion can pass while the argument is ignored.
Jira: https://numbers.atlassian.net/browse/RS-21803
Stacked PR
Based on
RS-21803-headervisibilityandcellformatting(#70), notmaster— these plans all add tests totests/testthat/test-createcustomtable.Rand share its helpers. Merge order: #66, #67, #68, #69, #70, then this. The diff against that base is this plan's work only.Test plan
245 passing, 0 failures, 0 warnings.
🤖 Generated with Claude Code