mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 09:12:18 +00:00
- 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]>
48 lines
1.3 KiB
JavaScript
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();
|
|
}
|
|
});
|