Skip to content

Commit

Permalink
chore: jest test for color scale conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
turban committed Sep 25, 2023
1 parent b27735e commit 7360e68
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/util/__tests__/getMigratedMapConfig.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,40 @@ test('getMigratedMapConfig with old GIS app format and Boundary layer', () => {
})
)
})

test('getMigratedMapConfig with colorScale converted to an array', () => {
const config = {
id: 'mapId',
name: 'map name',
basemap: { id: 'osmStreet' },
mapViews: [
{
layer: 'thematic',
name: 'Thematic layer',
colorScale: '#fee5d9,#fcbba1,#fc9272,#fb6a4a,#de2d26,#a50f15',
},
],
}

expect(getMigratedMapConfig(config, defaultBasemapId)).toEqual(
expect.objectContaining({
id: 'mapId',
name: 'map name',
basemap: { id: 'osmStreet' },
mapViews: [
{
layer: 'thematic',
name: 'Thematic layer',
colorScale: [
'#fee5d9',
'#fcbba1',
'#fc9272',
'#fb6a4a',
'#de2d26',
'#a50f15',
],
},
],
})
)
})

0 comments on commit 7360e68

Please sign in to comment.