Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/components/map/parts/tiles-property.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,19 @@ describe('TilesProperty', () => {
});
});

describe('live traffic breakpoints and congestion', () => {
it('should show speed without km/h unit', () => {
render(
<TilesProperty
propertyKey="live_traffic:forward:congestion0"
value={50}
/>
);
expect(screen.getByText('50')).toBeInTheDocument();
expect(screen.queryByText('km/h')).not.toBeInTheDocument();
});
});

describe('slope values', () => {
it('should show slope with degree unit', () => {
render(<TilesProperty propertyKey="max_up_slope" value={5} />);
Expand Down
5 changes: 4 additions & 1 deletion src/components/map/parts/tiles-property.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ export function TilesProperty({
);
}

if (propertyKey.includes('speed')) {
if (
propertyKey.includes('speed') &&
!(propertyKey.includes('congestion') || propertyKey.includes('breakpoint'))
) {
return (
<span className="font-mono text-xs">
{String(value)}
Expand Down