Files
houseplan-card/test/device-face.test.mjs
T
Matysh 112c260314
Validate / hacs (push) Failing after 12s
Validate / hassfest (push) Failing after 13s
Validate / frontend (push) Successful in 3m2s
Validate / golden (push) Failing after 51s
Validate / backend (push) Failing after 6m50s
Validate / smoke (push) Failing after 13m44s
Validate / performance (push) Failing after 24m13s
Release v1.61.0-beta.1
2026-08-09 21:51:33 +03:00

20 lines
743 B
JavaScript

import test from 'node:test';
import assert from 'node:assert/strict';
import { deviceFaceStyle } from '../test-build/device-face.js';
const face = (rippleColor) => ({
display: 'icon_ripple', scale: 1, rippleScale: 3, rippleColor,
});
test('device face never emits an arbitrary persisted ripple declaration', () => {
assert.deepEqual(deviceFaceStyle(face('#12aBcD')), [
'--ripple-scale:3', '--ripple-color:#12aBcD',
]);
assert.deepEqual(deviceFaceStyle(face('rgb(12, 140, 250)')), [
'--ripple-scale:3', '--ripple-color:rgb(12, 140, 250)',
]);
const hostile = deviceFaceStyle(face('red;position:fixed;inset:0'));
assert.deepEqual(hostile, ['--ripple-scale:3']);
assert.ok(!hostile.join(';').includes('position'));
});