Skip to content

Commit

Permalink
skip Stadia without key
Browse files Browse the repository at this point in the history
  • Loading branch information
mmomtchev committed Sep 2, 2024
1 parent f41185d commit f19e78f
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions test/RLayerMisc.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,24 @@ import RLayerStadia from 'rlayers/layer/RLayerStadia';
import * as common from './common';

describe('<RLayerStadia>', () => {
it('should display a tiled Stadia layer', () => {
const layer = React.createRef() as React.RefObject<RLayerStadia>;
const {container} = render(
<RMap {...common.mapProps}>
<RLayerStadia
ref={layer}
apiKey={process.env.STADIA_MAPS_API_KEY!}
layer='stamen_toner'
/>
</RMap>
);
expect((layer.current?.source.getUrls() || [])[0]).toBe(
`https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key=${process.env.STADIA_MAPS_API_KEY}`
);
});
(process.env.STADIA_MAPS_API_KEY ? it : it.skip)(
'should display a tiled Stadia layer',
function () {
const layer = React.createRef() as React.RefObject<RLayerStadia>;
const {container} = render(
<RMap {...common.mapProps}>
<RLayerStadia
ref={layer}
apiKey={process.env.STADIA_MAPS_API_KEY!}
layer='stamen_toner'
/>
</RMap>
);
expect((layer.current?.source.getUrls() || [])[0]).toBe(
`https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key=${process.env.STADIA_MAPS_API_KEY}`
);
}
);
});

describe('<RLayerWMS>', () => {
Expand Down

0 comments on commit f19e78f

Please sign in to comment.