mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Merge main through #794 into the renderer seam
This commit is contained in:
commit
bcfcce1150
32 files changed
+702
-70
No files matched your search
@@ -159,7 +159,8 @@ export function buildIncidentCard(row, nowMs, { link = null } = {}) {
|
||||
// the known cause, behavior and complexity values and the wording around them.
|
||||
const facts = [];
|
||||
if (Number.isFinite(row.acres)) {
|
||||
const acres = Math.round(row.acres);
|
||||
const acres =
|
||||
row.acres < 1 ? Math.round(row.acres * 100) / 100 : Math.round(row.acres);
|
||||
facts.push(
|
||||
tn(acres, '{acres} ac', '{acres} ac', { acres: formatNumber(acres) }),
|
||||
);
|
||||
|
||||
@@ -302,3 +302,34 @@ test('partial incident details render only the facts that exist', () => {
|
||||
'Catron County · $85K to date',
|
||||
]);
|
||||
});
|
||||
|
||||
test('a fire under one acre keeps its WFIGS size instead of reading 0 ac', () => {
|
||||
const row = {
|
||||
stableId: 'x',
|
||||
name: 'Grey',
|
||||
acres: 0.25,
|
||||
containedPct: null,
|
||||
state: 'US-WA',
|
||||
category: 'WF',
|
||||
discoveredTime: null,
|
||||
updatedTime: null,
|
||||
cause: null,
|
||||
behavior: null,
|
||||
personnel: null,
|
||||
county: null,
|
||||
costToDate: null,
|
||||
complexity: null,
|
||||
};
|
||||
assert.equal(
|
||||
buildIncidentCard(row, 1758000000000).details[0],
|
||||
'0.25 ac · containment unknown · US-WA',
|
||||
);
|
||||
assert.equal(
|
||||
buildIncidentCard({ ...row, acres: 0.01 }, 1758000000000).details[0],
|
||||
'0.01 ac · containment unknown · US-WA',
|
||||
);
|
||||
assert.equal(
|
||||
buildIncidentCard({ ...row, acres: 1.4 }, 1758000000000).details[0],
|
||||
'1 ac · containment unknown · US-WA',
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user