Files
gods-eye-view/src/layers/wind/staleInfo.test.mjs
T
German KhokhlovandClaude Opus 5.5 20f4cf3763 i18n: fix the LGTM review findings and tidy the branch texts
- i18n scanner: lastError sink, no false sinks on defaults and ternaries
- shared src/i18n/marker.js for modules that only mark strings
- wind field messages move to wind/fields.js; CITY_POIS imports from cityPois.js
- drop review IDs, change history and stale references from comments and docs

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 21:00:28 +04:00

48 lines
1.3 KiB
JavaScript

import test from 'node:test';
import assert from 'node:assert/strict';
import { setLocale } from '../../i18n/index.js';
import { createWindLayer } from './index.js';
test('stale wind forecast is marked in the UI language', async () => {
const rendering = Object.fromEntries(
['attach', 'start', 'stop', 'clear', 'destroy', 'setField'].map((n) => [
n,
() => {},
]),
);
rendering.getDiagnostics = () => ({});
const layer = createWindLayer({
feed: {
getSnapshot: async () => ({
model: 'gfs',
grid: { nx: 2, ny: 2 },
cycle: {
runIso: '2026-09-14T12:00:00Z',
validIso: '2026-09-14T18:00:00Z',
},
stale: true,
reason: 'Wind upstream unavailable',
}),
},
createRendering: () => rendering,
});
layer.init({ container: {} });
layer.enable();
await layer.update();
try {
assert.match(layer.getRowControls().info, / · STALE(\n|$)/);
for (const [locale, word] of [
['es', 'DESACTUALIZADO'],
['ru', 'УСТАРЕЛ'],
]) {
setLocale(locale);
const info = layer.getRowControls().info;
assert.doesNotMatch(info, /STALE/);
assert.match(info, new RegExp(word));
}
} finally {
setLocale('en');
layer.destroy();
}
});