mirror of
https://github.com/Matysh/houseplan-card
synced 2026-10-07 06:59:46 +00:00
fix: restore capsule outline for text markers
Issue: #217 User-Visible: yes
This commit is contained in:
@@ -47,6 +47,22 @@ test('issue 212 Text value uses a stadium radius based on height', () => {
|
||||
assert.doesNotMatch(rule, /border-radius:\s*50%/);
|
||||
});
|
||||
|
||||
test('issue 217 keeps the Text shell stadium while icon-only stays circular', () => {
|
||||
const styles = source('styles.ts');
|
||||
const frame = styles.match(/\.device-shell-frame\s*\{([\s\S]*?)\}/)?.[1] || '';
|
||||
const circle = styles.match(
|
||||
/\.device-shell:not\(\.with-values\):not\(\.text-shell\) \.device-shell-frame\s*\{([\s\S]*?)\}/,
|
||||
)?.[1] || '';
|
||||
|
||||
assert.match(frame, /border-radius:\s*9999px/);
|
||||
assert.match(circle, /border-radius:\s*50%/);
|
||||
assert.doesNotMatch(
|
||||
styles,
|
||||
/\.device-shell:not\(\.with-values\) \.device-shell-frame\s*\{[\s\S]*?border-radius:\s*50%/,
|
||||
'the circular override must not capture a wide Text shell',
|
||||
);
|
||||
});
|
||||
|
||||
test('issue 212 feedback is owned by actual dispatch and lasts 200 ms', () => {
|
||||
const card = source('houseplan-card.ts');
|
||||
assert.match(card, /private _startDevicePressFeedback\(/);
|
||||
|
||||
@@ -234,7 +234,7 @@ test('sun-ray golden requires browser-painted light from a state-only sun entity
|
||||
assert.ok(scenario);
|
||||
const fixture = prepareGoldenFixture(scenario);
|
||||
const space = fixture.config.spaces.find((item) => item.id === scenario.space);
|
||||
assert.equal(GOLDEN_MATRIX_VERSION, 32);
|
||||
assert.equal(GOLDEN_MATRIX_VERSION, 33);
|
||||
assert.equal(space.settings.sun_rays, true);
|
||||
assert.equal(scenario.northDeg, 90,
|
||||
'the sign-sensitive golden must keep a non-zero north direction');
|
||||
@@ -336,6 +336,27 @@ test('device icon state-table goldens cover both themes and design facets', () =
|
||||
}
|
||||
});
|
||||
|
||||
test('Text shell regression goldens isolate a large long value in both themes', () => {
|
||||
const scenarios = GOLDEN_SCENARIOS.filter((item) => item.id.startsWith('device-text-shell-long-'));
|
||||
assert.deepEqual(new Set(scenarios.map((scenario) => scenario.theme)), new Set(['light', 'dark']));
|
||||
for (const scenario of scenarios) {
|
||||
assert.equal(scenario.deviceOnly, 'golden-left-linkquality');
|
||||
const fixture = prepareGoldenFixture(scenario);
|
||||
const marker = fixture.config.markers.find((item) => item.id === 'golden-left-linkquality');
|
||||
assert.equal(marker.display, 'value');
|
||||
assert.equal(marker.size, 3);
|
||||
assert.equal(
|
||||
fixture.config.spaces.find((item) => item.id === scenario.space).settings.show_names,
|
||||
false,
|
||||
);
|
||||
assert.equal(fixture.states['sensor.golden_left_linkquality'].state, '498');
|
||||
assert.equal(
|
||||
fixture.states['sensor.golden_left_linkquality'].attributes.unit_of_measurement,
|
||||
'ppm',
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test('opening placement golden requires browser-painted preview pixels', () => {
|
||||
const door = GOLDEN_SCENARIOS.find(
|
||||
(item) => item.id === 'opening-placement-door-thick-wall-dark',
|
||||
|
||||
Reference in New Issue
Block a user