mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-15 15:52:21 +00:00
fix(transit): show a reported 359.6° bearing as hdg 0°, not hdg 360°
The selected-vehicle card rounded the operator's reported bearing without wrapping, so a GTFS-Realtime vehicle heading 359.5° or more read "reported hdg 360°". The card now wraps after rounding: 359.6° reads "reported hdg 0°", 359.4° still reads "reported hdg 359°".
This commit is contained in:
1 parent
a4d3701c3c
commit
812cdf6be7
3 files changed
+19
-2
No files matched your search
@@ -43,6 +43,18 @@ test('the selection card calls a Toronto 501 a streetcar', () => {
|
||||
assert.doesNotMatch(copy.details.join(' | '), /Tram/);
|
||||
});
|
||||
|
||||
test('the selection card reads a bearing that rounds to north as hdg 0°', () => {
|
||||
const hdg = (bearing) =>
|
||||
buildTransitSelectionCopy(
|
||||
ttc(),
|
||||
{ id: '4400', routeId: '501', timestamp: 0, bearing },
|
||||
'tram',
|
||||
0,
|
||||
).details.find((line) => line.includes('hdg'));
|
||||
assert.equal(hdg(359.4), 'reported hdg 359°');
|
||||
assert.equal(hdg(359.6), 'reported hdg 0°');
|
||||
});
|
||||
|
||||
test('detection labels carry the operator vocabulary within the field width', () => {
|
||||
const klass = transitDetectionClass('tram', ttc());
|
||||
assert.equal(klass, 'STREETCAR TTC');
|
||||
|
||||
Reference in new issue
Block a user