mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 03:09:36 +00:00
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
36 lines
1.3 KiB
JavaScript
36 lines
1.3 KiB
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { readFileSync } from 'node:fs';
|
|
|
|
const en = JSON.parse(readFileSync(new URL('../src/i18n/en.json', import.meta.url)));
|
|
const ru = JSON.parse(readFileSync(new URL('../src/i18n/ru.json', import.meta.url)));
|
|
|
|
test('i18n: en and ru dictionaries carry the same key set', () => {
|
|
const enKeys = Object.keys(en).sort();
|
|
const ruKeys = Object.keys(ru).sort();
|
|
assert.deepEqual(enKeys, ruKeys);
|
|
});
|
|
|
|
test('i18n: no empty values', () => {
|
|
for (const [lang, d] of [['en', en], ['ru', ru]]) {
|
|
for (const [k, v] of Object.entries(d)) {
|
|
assert.ok(typeof v === 'string' && v.length > 0, `${lang}:${k} is empty`);
|
|
}
|
|
}
|
|
});
|
|
|
|
test('i18n: placeholders match between languages', () => {
|
|
const ph = (s) => (s.match(/\{\w+\}/g) || []).sort().join(',');
|
|
for (const k of Object.keys(en)) {
|
|
assert.equal(ph(en[k]), ph(ru[k]), `placeholder mismatch in ${k}`);
|
|
}
|
|
});
|
|
|
|
test('vac toasts never mention the removed point calibration (HP-1540-06)', () => {
|
|
for (const [lang, d] of [['en', en], ['ru', ru]]) {
|
|
for (const k of ['vac.autocal_no_rooms', 'vac.autocal_no_match', 'vac.residual_message']) {
|
|
assert.ok(!/point|точк/i.test(d[k]), `${lang}:${k} still points at point calibration`);
|
|
}
|
|
}
|
|
});
|