mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-03 01:28:55 +00:00
refactor(weather): share the day weather anchor and icon map between desktop and phone
The day plan, the day panel, the phone timeline and the phone day sheet read the day local weather anchor from dayWeatherAnchor, and every weather icon comes from one map in weatherIcons.
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { Cloud, CloudLightning, CloudRain, CloudSnow, Sun, Wind } from 'lucide-react'
|
||||
import {
|
||||
breaksChronology, buildPlanRows, cityPillsForDay, findUpNext, getTransitMeta, hotelChipsForDay,
|
||||
hotelLegsForDay, itemHasTime, parseReservationMeta, transportSubtitle, weatherIconFor,
|
||||
hotelLegsForDay, itemHasTime, parseReservationMeta, transportSubtitle,
|
||||
type TransportEntry,
|
||||
} from '../../../../src/mobile/screens/trip/plan/planTimelineModel'
|
||||
import { getDisplayTimeForDay, getMergedItems, getTransportForDay, type MergedItem } from '../../../../src/utils/dayMerge'
|
||||
@@ -847,15 +846,3 @@ describe('planTimelineModel — chronology helpers', () => {
|
||||
expect(getDisplayTime).toHaveBeenCalledWith(bus.data, 2)
|
||||
})
|
||||
})
|
||||
|
||||
describe('planTimelineModel — weatherIconFor', () => {
|
||||
it('FE-MOB-PTLM-041: maps the known conditions and defaults to a cloud', () => {
|
||||
expect(weatherIconFor('Clear')).toBe(Sun)
|
||||
expect(weatherIconFor('Rain')).toBe(CloudRain)
|
||||
expect(weatherIconFor('Thunderstorm')).toBe(CloudLightning)
|
||||
expect(weatherIconFor('Snow')).toBe(CloudSnow)
|
||||
expect(weatherIconFor('Haze')).toBe(Wind)
|
||||
expect(weatherIconFor('Tornado')).toBe(Cloud)
|
||||
expect(weatherIconFor(undefined)).toBe(Cloud)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user