Skip to content

Commit

Permalink
test: use correct layerswitcher button to press
Browse files Browse the repository at this point in the history
  • Loading branch information
simonseyock committed Jun 4, 2024
1 parent 1350c97 commit aeafdba
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/LayerSwitcher/LayerSwitcher.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ describe('<LayerSwitcher />', () => {

it('switches the visible layer on click', async () => {
const { container } = renderInMapContext(map, <LayerSwitcher layers={layers} />);
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();
Expand Down

0 comments on commit aeafdba

Please sign in to comment.