Skip to content

Commit

Permalink
geosolutions-it#10487: Custom Tile Grids settings for WMS service are…
Browse files Browse the repository at this point in the history
… not retained when adding a Background layer from Catalog [resolve review]

- revert the changes in BackgroundDialog file + its test file
  • Loading branch information
mahmoudadel54 committed Jul 31, 2024
1 parent 5df6e20 commit 39aa180
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 43 deletions.
1 change: 0 additions & 1 deletion web/client/components/background/BackgroundDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ export default class BackgroundDialog extends React.Component {
projection={this.props.projection}
onChange={value => this.setState(value)}
disableTileGrids={this.props.disableTileGrids}
owner={"background-dialog"}
/>
</FormGroup>}
<Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,15 @@ import * as TestUtils from 'react-dom/test-utils';
import expect from 'expect';
import BackgroundDialog from '../BackgroundDialog';

import axios from '../../../libs/ajax';
import MockAdapter from 'axios-mock-adapter';
import { waitFor } from '@testing-library/react';
let mockAxios;

describe('test BackgroundDialog', () => {
beforeEach((done) => {
document.body.innerHTML = '<div id="container"></div>';
mockAxios = new MockAdapter(axios);
setTimeout(done);
});

afterEach((done) => {
ReactDOM.unmountComponentAtNode(document.getElementById("container"));
document.body.innerHTML = '';
if (mockAxios) {
mockAxios.restore();
}
mockAxios = null;
setTimeout(done);
});

Expand Down Expand Up @@ -93,36 +83,4 @@ describe('test BackgroundDialog', () => {
const wmsCacheOptionsToolbar = document.querySelector('.ms-wms-cache-options-toolbar');
expect(wmsCacheOptionsToolbar).toBeTruthy();
});
it('should render with WMS cache options with remoteTileGrids = true', (done) => {
mockAxios.onGet().replyOnce(200, {
tileMatrixSets: [],
tileMatrixSetLinks: [],
tileGrids: [],
styles: [],
formats: []
});
ReactDOM.render(<BackgroundDialog
layer={{
type: 'wms',
url: '/geoserver/wms',
name: 'workspace:name',
remoteTileGrids: true
}}
/>,
document.getElementById("container"));
const modalNode = document.querySelector('#ms-resizable-modal');
expect(modalNode).toBeTruthy();
const wmsCacheOptionsContent = document.querySelector('.ms-wms-cache-options-content');
expect(wmsCacheOptionsContent).toBeTruthy();
const wmsCacheOptionsToolbar = document.querySelector('.ms-wms-cache-options-toolbar');
expect(wmsCacheOptionsToolbar).toBeTruthy();
waitFor(()=>expect(document.querySelector('.ms-wms-cache-options-toolbar button.active span.glyphicon-grid-custom')).toBeTruthy())
.then(()=>{
const wmsCacheCustomGridOption = document.querySelector('.ms-wms-cache-options-toolbar button.active span.glyphicon-grid-custom');
expect(wmsCacheCustomGridOption).toBeTruthy();
const wmsCacheRefreshOption = document.querySelector('.ms-wms-cache-options-toolbar .glyphicon-refresh');
expect(wmsCacheRefreshOption).toBeTruthy();
done();
}).catch(done);
});
});

0 comments on commit 39aa180

Please sign in to comment.