Geomap: Ensure default marker path consistency (#111912)

* Geomap: Ensure default marker path consistency

* Remove redundant comments

* Revert migration test
This commit is contained in:
Drew Slobodnjak
2025-10-08 12:03:39 -07:00
committed by GitHub
parent 8a59baa7d5
commit d247f3ef4a
3 changed files with 30 additions and 2 deletions
@@ -76,7 +76,7 @@ describe('Worldmap Migrations', () => {
"min": 2,
},
"symbol": {
"fixed": "build/img/icons/marker/circle.svg",
"fixed": "img/icons/marker/circle.svg",
"mode": "fixed",
},
"symbolAlign": {
@@ -8,7 +8,10 @@ import {
opacityExpression,
rotationExpression,
offsetExpression,
getMarkerMaker,
circleMarker,
} from './markers';
import { defaultStyleConfig } from './types';
// Mock dependencies
jest.mock('app/features/dimensions/resource', () => ({
@@ -101,3 +104,28 @@ describe('getWebGLStyle', () => {
consoleErrorSpy.mockRestore();
});
});
describe('Icon Path Consistency', () => {
const circleIconPath = 'img/icons/marker/circle.svg';
beforeEach(() => {
jest.clearAllMocks();
});
it('should use consistent paths between default and selected circle icons', () => {
expect(defaultStyleConfig.symbol.fixed).toBe(circleIconPath);
});
it('should handle default and explicitly selected circle icons the same way for WebGL style', async () => {
const defaultStyle = await getWebGLStyle(); // No symbol
const explicitCircleStyle = await getWebGLStyle(circleIconPath);
expect(explicitCircleStyle).toEqual(defaultStyle);
});
it('should create valid marker maker for default icon', async () => {
const defaultMaker = await getMarkerMaker(); // No symbol
expect(defaultMaker).toBe(circleMarker);
});
});
@@ -74,7 +74,7 @@ export const defaultStyleConfig = Object.freeze({
opacity: 0.4,
symbol: {
mode: ResourceDimensionMode.Fixed,
fixed: 'build/img/icons/marker/circle.svg',
fixed: 'img/icons/marker/circle.svg',
},
symbolAlign: {
horizontal: HorizontalAlign.Center,