-
Notifications
You must be signed in to change notification settings - Fork 404
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
31e2c92
commit 61cdc4e
Showing
6 changed files
with
78 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
web/client/product/components/viewer/about/__tests__/About-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* Copyright 2022, GeoSolutions Sas. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import expect from 'expect'; | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import AboutComp from '../About'; | ||
|
||
describe("The About component", () => { | ||
beforeEach((done) => { | ||
document.body.innerHTML = '<div id="container"></div>'; | ||
setTimeout(done); | ||
}); | ||
|
||
afterEach((done) => { | ||
ReactDOM.unmountComponentAtNode(document.getElementById("container")); | ||
document.body.innerHTML = ''; | ||
setTimeout(done); | ||
}); | ||
|
||
it('test about plugin content/version info', () => { | ||
const cmp = ReactDOM.render(<AboutComp enabled />, document.getElementById("container")); | ||
expect(cmp).toBeTruthy(); | ||
const aboutComNodes = document.querySelector("#mapstore-about .modal-body div").childNodes; | ||
expect(aboutComNodes.length).toEqual(2); | ||
const versionInfoCmp = document.querySelector("#mapstore-about .version-panel"); | ||
expect(versionInfoCmp).toBeTruthy(); | ||
const aboutContentCmp = document.querySelector("#mapstore-about .about-content-section"); | ||
expect(aboutContentCmp).toBeTruthy(); | ||
}); | ||
it('test hide version info in about plugin and showing only content section', () => { | ||
const cmp = ReactDOM.render(<AboutComp enabled showVersionInfo={false} />, document.getElementById("container")); | ||
expect(cmp).toBeTruthy(); | ||
const aboutComNodes = document.querySelector("#mapstore-about .modal-body div").childNodes; | ||
expect(aboutComNodes.length).toEqual(1); | ||
const versionInfoCmp = document.querySelector("#mapstore-about .version-panel"); | ||
expect(versionInfoCmp).toBeFalsy(); | ||
const aboutContentCmp = document.querySelector("#mapstore-about .about-content-section"); | ||
expect(aboutContentCmp).toBeTruthy(); | ||
}); | ||
it('test hide content section in about plugin and showing only version info section', () => { | ||
const cmp = ReactDOM.render(<AboutComp enabled showAboutContent={false} />, document.getElementById("container")); | ||
expect(cmp).toBeTruthy(); | ||
const aboutComNodes = document.querySelector("#mapstore-about .modal-body div").childNodes; | ||
expect(aboutComNodes.length).toEqual(1); | ||
const versionInfoCmp = document.querySelector("#mapstore-about .version-panel"); | ||
expect(versionInfoCmp).toBeTruthy(); | ||
const aboutContentCmp = document.querySelector("#mapstore-about .about-content-section"); | ||
expect(aboutContentCmp).toBeFalsy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters