mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-28 19:06:19 -05:00
test: act on review — two of the new table guards could not fail
The jest column-border test asserted the TABLE lacks `data-with-column-border`.
Mantine puts that marker on the cells, never on the table, so the expectation
held whether column borders were on or off. It now looks for the marker
anywhere in the tree.
I did plant a regression for this one -- and ran it against cypress only, where
a different test caught it. The plant was right and the suite was wrong, which
is a new way to get a false green and worth naming: run every suite that claims
the behaviour, not the one that happens to be open.
The header-surface test fell back to `getComputedStyle(documentElement)
.backgroundColor` for an unstriped row. `body` carries the page colour and the
root element carries none, so that is `rgba(0, 0, 0, 0)` and any opaque header
passed. It now compares against the `--bg` token, which is what actually shows
through an unstriped row, and additionally asserts the body really is striped
so both kinds are covered. Planted the exact case the old form could not see
-- a header painted `--bg` -- and it goes red in all four themes.
The file-row fixture rendered a 16px icon; the app renders 24. A file row
calls `<FileIcon size={null}/>`, and a null size falls past Icon's 'small'
default to Tabler's 24 -- the harder centring case, and the one the CSS comment
describes. Added the two-glyph row as well, since a folder that is also ignored
draws two icons before its name and those touched each other too.
The header-rule-width assertion now runs per theme with the rest of the suite.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
eab13e4803
commit
2fda9e8975
2 changed files with 74 additions and 23 deletions
|
|
@ -741,8 +741,10 @@ describe('Table', () => {
|
|||
/*
|
||||
* A full grid is a lot of ink to repeat what the column headings already say, and
|
||||
* it cost the header its identity: with no surface of its own, a bordered header
|
||||
* cell looked like one more cell in the grid. Mantine marks the choice on the
|
||||
* table, so the absence is assertable without a browser.
|
||||
* cell looked like one more cell in the grid.
|
||||
*
|
||||
* The marker goes on the CELLS. Asserting the table lacks it is free -- the table
|
||||
* never carries it either way -- which is what this test did at first.
|
||||
*/
|
||||
const {container} = renderUI(<Table>
|
||||
<Table.Body>
|
||||
|
|
@ -750,10 +752,9 @@ describe('Table', () => {
|
|||
</Table.Body>
|
||||
</Table>);
|
||||
|
||||
const table = container.querySelector('table');
|
||||
expect(table).not.toHaveAttribute('data-with-column-border');
|
||||
// The outline around the table is a different thing and stays.
|
||||
expect(table).toHaveAttribute('data-with-table-border');
|
||||
expect(container.querySelector('[data-with-column-border]')).toBeNull();
|
||||
// The outline around the table is a different thing, and it does live on the table.
|
||||
expect(container.querySelector('table')).toHaveAttribute('data-with-table-border');
|
||||
});
|
||||
|
||||
it('marks failed rows for the danger border', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue