Fix route spec

This commit is contained in:
Eugene Burmakin 2025-12-10 19:57:45 +01:00
parent 7c5aedfac0
commit 1983f5038e
2 changed files with 11 additions and 2 deletions

View file

@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Redis client now also being configured so that it could connect via unix socket. #1970
- Importing KML files now creates points with correct timestamps. #1988
- Importing KMZ files now works correctly.
- Map settings are now being respected in map v2. #2012
# [0.36.2] - 2025-12-06

View file

@ -124,8 +124,16 @@ test.describe('Routes Layer', () => {
expect(routeLayerInfo).toBeTruthy()
expect(routeLayerInfo.exists).toBe(true)
expect(routeLayerInfo.isArray).toBe(false)
expect(routeLayerInfo.value).toBe('#f97316')
// Route color is now a MapLibre expression that supports dynamic colors
// Format: ['case', ['has', 'color'], ['get', 'color'], '#0000ff']
if (routeLayerInfo.isArray) {
// It's a MapLibre expression, check the default color (last element)
expect(routeLayerInfo.value[routeLayerInfo.value.length - 1]).toBe('#0000ff')
} else {
// Solid color (fallback)
expect(routeLayerInfo.value).toBe('#0000ff')
}
})
})