mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-25 09:26:17 -05:00
ui: an inactive tab was a near-white block in dark, night and amber
Found while checking tags in the gallery, and unrelated to them. A tab is a NavLink in the app's nav bars, but a <button> on the Inventory page and in the theme gallery. A button carries the UA's own `buttonface` background -- rgb(239, 239, 239) in Chrome -- and only `.wrolpi-tab-active` set a background, so every inactive tab painted that near-white block. Invisible in light, and a bright patch in the other three; in night it is the one thing the theme exists to prevent. One line, and a test in all four themes.
This commit is contained in:
parent
b5884e2d2c
commit
55d63b2c28
3 changed files with 320 additions and 7 deletions
|
|
@ -573,6 +573,32 @@ describe('Label', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('Label as a tag', () => {
|
||||
it('is a plain chip unless asked to be a tag', () => {
|
||||
// The same component carries the count badges in the Tags table -- file, zim, channel
|
||||
// and domain counts -- and a pointed left edge on a number reads as an arrow.
|
||||
const {container} = renderUI(<Label color='blue'>1,432</Label>);
|
||||
|
||||
expect(container.querySelector('.wrolpi-label')).toBeInTheDocument();
|
||||
expect(container.querySelector('.wrolpi-tag')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('takes the tag shape when asked', () => {
|
||||
const {container} = renderUI(<Label tag color='blue'>Water</Label>);
|
||||
|
||||
expect(container.querySelector('.wrolpi-tag')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('leaves the text colour to the stylesheet', () => {
|
||||
// Every label routes its text colour through `--label-text` so that night and amber,
|
||||
// which replace the fill with their own, can replace the text colour with it. An
|
||||
// inline `color` could not be overridden by either.
|
||||
const {container} = renderUI(<Label tag color='blue'>Water</Label>);
|
||||
|
||||
expect(container.querySelector('.wrolpi-label').style.color).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Table', () => {
|
||||
it('renders a Semantic-shaped compound table', () => {
|
||||
renderUI(<Table>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue