From aeafdbad18cacd9a914bb842ef0b0a19e7400f4b Mon Sep 17 00:00:00 2001 From: Simon Seyock Date: Tue, 4 Jun 2024 17:52:37 +0200 Subject: [PATCH] test: use correct layerswitcher button to press --- src/LayerSwitcher/LayerSwitcher.spec.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/LayerSwitcher/LayerSwitcher.spec.tsx b/src/LayerSwitcher/LayerSwitcher.spec.tsx index 8f7105f1f..7b2fac378 100644 --- a/src/LayerSwitcher/LayerSwitcher.spec.tsx +++ b/src/LayerSwitcher/LayerSwitcher.spec.tsx @@ -78,7 +78,11 @@ describe('', () => { it('switches the visible layer on click', async () => { const { container } = renderInMapContext(map, ); - const switcher = within(container).getByRole('button'); + + // eslint-disable-next-line testing-library/no-container,testing-library/no-node-access + const layerSwitcher = container.querySelector('.react-geo-layer-switcher'); + + const switcher = within(layerSwitcher).getByRole('button'); const layer0visible = layers[0].getVisible(); const layer1visible = layers[1].getVisible();