Skip to content

Commit

Permalink
chore(external-viewer): use mapstore template syntax in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tkohr committed Dec 19, 2023
1 parent 497900c commit 387b474
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('ExternalViewerButtonComponent', () => {
})
it('opens window in new tab with URL including WMS link params', () => {
expect(openMock).toHaveBeenCalledWith(
'https://example.com/myviewer?url=http%3A%2F%2Fexample.com%2Fows%3Fservice%3Dwms%26request%3Dgetcapabilities&name=layername&type=wms',
'https://example.com/myviewer/#/?actions=[{"type":"CATALOG:ADD_LAYERS_FROM_CATALOGS","layers":["layername"],"sources":[{"url":"http%3A%2F%2Fexample.com%2Fows%3Fservice%3Dwms%26request%3Dgetcapabilities","type":"wms"}]}]',
'_blank'
)
})
Expand Down Expand Up @@ -138,7 +138,7 @@ describe('ExternalViewerButtonComponent', () => {
})
it('opens window in new tab with URL including WFS link params', () => {
expect(openMock).toHaveBeenCalledWith(
'https://example.com/myviewer?url=http%3A%2F%2Fexample.com%2Fows%3Fservice%3Dwfs%26request%3Dgetcapabilities&name=layername&type=wfs',
'https://example.com/myviewer/#/?actions=[{"type":"CATALOG:ADD_LAYERS_FROM_CATALOGS","layers":["layername"],"sources":[{"url":"http%3A%2F%2Fexample.com%2Fows%3Fservice%3Dwfs%26request%3Dgetcapabilities","type":"wfs"}]}]',
'_blank'
)
})
Expand Down Expand Up @@ -184,7 +184,7 @@ describe('ExternalViewerButtonComponent', () => {
})
it('opens window in new tab with URL including link params', () => {
expect(openMock).toHaveBeenCalledWith(
'https://example.com/myviewer?url=http%3A%2F%2Fexample.com%2Fsomespatialdata.geojson&name=externalviewer.dataset.unnamed&type=geojson',
'https://example.com/myviewer/#/?actions=[{"type":"CATALOG:ADD_LAYERS_FROM_CATALOGS","layers":["externalviewer.dataset.unnamed"],"sources":[{"url":"http%3A%2F%2Fexample.com%2Fsomespatialdata.geojson","type":"geojson"}]}]',
'_blank'
)
})
Expand Down
2 changes: 1 addition & 1 deletion libs/util/app-config/src/lib/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const MAP_CONFIG_FIXTURE: MapConfig = {
MAX_EXTENT: [-418263.418776, 5251529.591305, 961272.067714, 6706890.609855],
DO_NOT_USE_DEFAULT_BASEMAP: false,
EXTERNAL_VIEWER_URL_TEMPLATE:
'https://example.com/myviewer?url=${service_url}&name=${layer_name}&type=${service_type}',
'https://example.com/myviewer/#/?actions=[{"type":"CATALOG:ADD_LAYERS_FROM_CATALOGS","layers":["${layer_name}"],"sources":[{"url":"${service_url}","type":"${service_type}"}]}]',
EXTERNAL_VIEWER_OPEN_NEW_TAB: true,
MAP_LAYERS: [
{
Expand Down

0 comments on commit 387b474

Please sign in to comment.