mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 03:09:36 +00:00
committed by
claude[bot]
parent
6103e7de68
commit
6aca447fa0
@@ -0,0 +1,25 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
|
||||
const source = (path) => readFileSync(new URL(`../${path}`, import.meta.url), 'utf8');
|
||||
|
||||
test('#565 View keeps native space buttons and exposes one current page', () => {
|
||||
const card = source('src/houseplan-card.ts');
|
||||
assert.match(card, /<nav class="tabs" aria-label=\$\{this\._t\('nav\.spaces'\)\}/);
|
||||
assert.match(card, /aria-current=\$\{this\._space === s\.id \? 'page' : nothing\}/);
|
||||
assert.doesNotMatch(card, /role="tablist"|role="tab"/);
|
||||
});
|
||||
|
||||
test('#565 keyboard tooltip has explicit focus ownership and room labels stay untouched', () => {
|
||||
const card = source('src/houseplan-card.ts');
|
||||
const hover = source('src/live-hover.ts');
|
||||
const staticCard = source('src/space-render.ts');
|
||||
assert.match(card, /@focus=\$\{\(e: FocusEvent\) => this\._showDeviceFocusTip\(e, d\)\}/);
|
||||
assert.match(card, /@focusout=\$\{\(\) => this\._hideDeviceFocusTip\(d\.id\)\}/);
|
||||
assert.match(hover, /!target\?\.matches\(':focus-visible'\)/);
|
||||
assert.match(hover, /marker\?\.matches\(':focus-visible'\)/);
|
||||
assert.match(card, /style="left:\$\{left\}%;top:\$\{top\}%;color:\$\{disp\.color\};opacity:\$\{op\};--rl-scale:/);
|
||||
assert.match(staticCard, /style="left:\$\{left\}%;top:\$\{top\}%;color:\$\{disp\.color\};opacity:\$\{op\}"/);
|
||||
assert.doesNotMatch(staticCard, /_showDeviceFocusTip|@focus=/);
|
||||
});
|
||||
Reference in New Issue
Block a user