test(AboutPage, ConfirmDialog, MapPage): update tests for improved component behavior and UI consistency

This commit is contained in:
2026-01-04 00:07:21 -06:00
parent c7c70a5868
commit 5a995c7304
3 changed files with 22 additions and 9 deletions

View File

@@ -19,6 +19,12 @@ vi.mock("ol/Map", () => ({
on: vi.fn(),
addLayer: vi.fn(),
addInteraction: vi.fn(),
addOverlay: vi.fn(),
removeInteraction: vi.fn(),
removeOverlay: vi.fn(),
un: vi.fn(),
getEventPixel: vi.fn().mockReturnValue([0, 0]),
getTargetElement: vi.fn().mockReturnValue({ style: {} }),
getView: vi.fn().mockReturnValue({
on: vi.fn(),
setCenter: vi.fn(),
@@ -33,6 +39,9 @@ vi.mock("ol/Map", () => ({
push: vi.fn(),
getArray: vi.fn().mockReturnValue([]),
}),
getOverlays: vi.fn().mockReturnValue({
getArray: vi.fn().mockReturnValue([]),
}),
forEachFeatureAtPixel: vi.fn(),
setTarget: vi.fn(),
updateSize: vi.fn(),
@@ -129,10 +138,12 @@ describe("MapPage.vue", () => {
patch: vi.fn().mockResolvedValue({ data: {} }),
delete: vi.fn().mockResolvedValue({ data: {} }),
};
vi.stubGlobal("axios", axiosMock);
window.axios = axiosMock;
});
beforeEach(() => {
vi.stubGlobal("axios", axiosMock);
window.axios = axiosMock;
// Mock localStorage
const localStorageMock = {