diff --git a/source/frontend/src/components/maps/leaflet/Control/LayersControl/LayersControl.test.tsx b/source/frontend/src/components/maps/leaflet/Control/LayersControl/LayersControl.test.tsx
index 843caab83b..1090fa9c55 100644
--- a/source/frontend/src/components/maps/leaflet/Control/LayersControl/LayersControl.test.tsx
+++ b/source/frontend/src/components/maps/leaflet/Control/LayersControl/LayersControl.test.tsx
@@ -15,7 +15,7 @@ function Template({ openByDefault = false }) {
const toggle = () => {
setOpen(!open);
};
- return ;
+ return ;
}
function setup(ui = , setMap = noop) {
@@ -26,18 +26,10 @@ function setup(ui = , setMap = noop) {
return {
...utils,
ready: promise,
- findLayerList: () => document.querySelector('#layersContainer') as HTMLElement,
findToggleButton: () => document.querySelector('#layersControlButton') as HTMLElement,
};
}
-function isLayerVisible(key: string, leaflet: any) {
- return Object.keys(leaflet._layers)
- .map(k => leaflet._layers[k])
- .map(x => x.options)
- .find(options => options?.key === key);
-}
-
describe('LayersControl View', () => {
afterEach(cleanup);
@@ -52,50 +44,4 @@ describe('LayersControl View', () => {
const toggleBtn = findToggleButton();
expect(toggleBtn).toBeInTheDocument();
});
-
- it('should be closed by default', async () => {
- const { ready, findLayerList } = setup();
- await waitFor(() => ready);
- const layersContainer = findLayerList();
- expect(layersContainer).toBeInTheDocument();
- expect(layersContainer.className).toContain('closed');
- });
-
- it('when closed, clicking the button should open the layer list', async () => {
- const { ready, findLayerList, findToggleButton } = setup();
- await waitFor(() => ready);
- // when layer list is closed...
- const layersContainer = findLayerList();
- expect(layersContainer).toBeInTheDocument();
- expect(layersContainer.className).toContain('closed');
- // clicking the button should open it...
- const toggleBtn = findToggleButton();
- await act(async () => userEvent.click(toggleBtn));
- await waitFor(() => expect(layersContainer.className).not.toContain('closed'));
- });
-
- it('when open, clicking the button should close the layers list', async () => {
- const { ready, findLayerList, findToggleButton } = setup();
- await waitFor(() => ready);
- // when layer list is open...
- const layersContainer = findLayerList();
- expect(layersContainer).toBeInTheDocument();
- expect(layersContainer.className).not.toContain('closed');
- // clicking the button should close it...
- const toggleBtn = findToggleButton();
- await act(async () => userEvent.click(toggleBtn));
- await waitFor(() => expect(layersContainer.className).toContain('closed'));
- });
-
- it('should enable the Parcels layer and disable the Municipality layer by default', async () => {
- let mapInstance: L.Map | undefined = undefined;
- function setMap(map: L.Map) {
- mapInstance = map;
- }
- const { ready } = setup(, setMap);
- await waitFor(() => ready);
- await waitFor(() => expect(mapInstance).toBeDefined());
- expect(isLayerVisible('parcelBoundaries', mapInstance)).toBeDefined();
- expect(isLayerVisible('municipalities', mapInstance)).toBeUndefined();
- });
});
diff --git a/source/frontend/src/features/properties/map/MapContainer.test.tsx b/source/frontend/src/features/properties/map/MapContainer.test.tsx
index 75f41bcf01..5605290c2b 100644
--- a/source/frontend/src/features/properties/map/MapContainer.test.tsx
+++ b/source/frontend/src/features/properties/map/MapContainer.test.tsx
@@ -80,6 +80,7 @@ jest.mock('react-visibility-sensor', () => {
exportPropertiesApi: jest.fn(),
getPropertiesApi: jest.fn(),
getPropertyConceptWithIdApi: jest.fn(),
+ getPropertyConceptWithPidApi: jest.fn(),
putPropertyConceptApi: jest.fn(),
});
diff --git a/source/frontend/src/features/properties/map/__snapshots__/MapContainer.test.tsx.snap b/source/frontend/src/features/properties/map/__snapshots__/MapContainer.test.tsx.snap
index c62075b110..1f4dcc945e 100644
--- a/source/frontend/src/features/properties/map/__snapshots__/MapContainer.test.tsx.snap
+++ b/source/frontend/src/features/properties/map/__snapshots__/MapContainer.test.tsx.snap
@@ -1519,7 +1519,7 @@ exports[`MapContainer Renders the map 1`] = `
class="c18 text-left col-12"
>
+
+
+
+
+
+
+
+ Retired
+
+
+