-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18905a4
commit 79f789c
Showing
21 changed files
with
136 additions
and
49 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
49 changes: 49 additions & 0 deletions
49
web/client/components/tutorial/__tests__/CesiumTooltip-test.jsx
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,49 @@ | ||
/* | ||
* Copyright 2017, 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. | ||
*/ | ||
|
||
const expect = require('expect'); | ||
const React = require('react'); | ||
const ReactDOM = require('react-dom'); | ||
const CesiumTooltip = require('../steps/CesiumTooltip'); | ||
|
||
describe("Test the Cesium tooltip component", () => { | ||
|
||
beforeEach((done) => { | ||
document.body.innerHTML = '<div id="container"></div>'; | ||
setTimeout(done); | ||
}); | ||
|
||
afterEach((done) => { | ||
ReactDOM.unmountComponentAtNode(document.getElementById("container")); | ||
document.body.innerHTML = ''; | ||
expect.restoreSpies(); | ||
setTimeout(done); | ||
}); | ||
|
||
it('test default component', () => { | ||
const cmp = ReactDOM.render(<CesiumTooltip/>, document.getElementById("container")); | ||
expect(cmp).toExist(); | ||
const domNode = ReactDOM.findDOMNode(cmp); | ||
expect(domNode).toExist(); | ||
expect(domNode.children.length).toBe(1); | ||
const tr = domNode.getElementsByTagName('TR'); | ||
expect(tr.length).toBe(5); | ||
|
||
}); | ||
|
||
it('test default component with touch', () => { | ||
const cmp = ReactDOM.render(<CesiumTooltip touch={true}/>, document.getElementById("container")); | ||
expect(cmp).toExist(); | ||
const domNode = ReactDOM.findDOMNode(cmp); | ||
expect(domNode).toExist(); | ||
expect(domNode.children.length).toBe(1); | ||
const tr = domNode.getElementsByTagName('TR'); | ||
expect(tr.length).toBe(7); | ||
}); | ||
|
||
}); |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/** | ||
/* | ||
* Copyright 2017, GeoSolutions Sas. | ||
* All rights reserved. | ||
* | ||
|
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
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
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,33 @@ | ||
/* | ||
* Copyright 2017, 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. | ||
*/ | ||
|
||
const Rx = require('rxjs'); | ||
const {START_TUTORIAL, closeTutorial} = require('../actions/tutorial'); | ||
const {TOGGLE_3D} = require('../actions/globeswitcher'); | ||
|
||
/** | ||
* Closes the tutorial if 3D button has been toggled | ||
* @memberof epics.tutorial | ||
* @param {external:Observable} action$ manages `START_TUTORIAL` | ||
* @return {external:Observable} | ||
*/ | ||
|
||
const closeTutorialEpic = (action$) => | ||
action$.ofType(START_TUTORIAL) | ||
.audit(() => action$.ofType(TOGGLE_3D)) | ||
.switchMap( () => Rx.Observable.of(closeTutorial())); | ||
|
||
/** | ||
* Epics for Tutorial | ||
* @name epics.tutorial | ||
* @type {Object} | ||
*/ | ||
|
||
module.exports = { | ||
closeTutorialEpic | ||
}; |
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
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
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