kopia lustrzana https://github.com/OpenDroneMap/WebODM
Fixed jest tests
rodzic
134ae42ac5
commit
bf669857ed
|
@ -80,8 +80,8 @@ module.exports = {
|
|||
"SystemJS": "SystemJS",
|
||||
"PluginsAPI": "PluginsAPI",
|
||||
"leaflet": "leaflet",
|
||||
"ReactDOM": "ReactDOM",
|
||||
"React": "React"
|
||||
"react-dom": "ReactDOM",
|
||||
"react": "React"
|
||||
},
|
||||
|
||||
watchOptions: {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import L from 'leaflet';
|
||||
import ReactDOM from 'ReactDOM';
|
||||
import ReactDOM from 'react-dom';
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import '../css/LayersControl.scss';
|
||||
|
|
|
@ -441,9 +441,7 @@ https://a.tile.openstreetmap.org/{z}/{x}/{y}.png
|
|||
style={{height: "100%"}}
|
||||
ref={(domNode) => (this.container = domNode)}
|
||||
onMouseDown={this.handleMapMouseDown}
|
||||
>
|
||||
</div>
|
||||
|
||||
/>
|
||||
|
||||
<div className="actionButtons">
|
||||
{this.state.pluginActionButtons.map((button, i) => <div key={i}>{button}</div>)}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import Histogram from '../Histogram';
|
||||
|
||||
describe('<Histogram />', () => {
|
||||
it('renders without exploding', () => {
|
||||
const wrapper = mount(<Histogram statistics={{}} />);
|
||||
expect(wrapper.exists()).toBe(true);
|
||||
})
|
||||
});
|
|
@ -8,7 +8,7 @@ sinon.useFakeXMLHttpRequest();
|
|||
describe('<Map />', () => {
|
||||
it('renders without exploding', () => {
|
||||
const wrapper = mount(<Map
|
||||
tiles={['/']} />);
|
||||
tiles={[]} />);
|
||||
|
||||
expect(wrapper.exists()).toBe(true);
|
||||
})
|
||||
|
|
|
@ -413,6 +413,12 @@ class TestApiTask(BootTransactionTestCase):
|
|||
self.assertTrue(len(metadata['algorithms']) > 0)
|
||||
self.assertTrue(len(metadata['color_maps']) > 0)
|
||||
|
||||
# Algorithms have valid keys
|
||||
for k in ['id', 'filters', 'expr', 'help']:
|
||||
for a in metadata['algorithms']:
|
||||
self.assertTrue(k in a)
|
||||
self.assertTrue(len(a['filters']) > 0)
|
||||
|
||||
# Colormap is for algorithms
|
||||
self.assertEqual(len([x for x in metadata['color_maps'] if x['key'] == 'rdylgn']), 1)
|
||||
self.assertEqual(len([x for x in metadata['color_maps'] if x['key'] == 'jet_r']), 0)
|
||||
|
@ -472,6 +478,9 @@ class TestApiTask(BootTransactionTestCase):
|
|||
self.assertEqual(i.width, 512)
|
||||
self.assertEqual(i.height, 512)
|
||||
|
||||
# TODO: Test hillshade
|
||||
|
||||
|
||||
# Another user does not have access to the resources
|
||||
other_client = APIClient()
|
||||
other_client.login(username="testuser2", password="test1234")
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
"css-loader": "^0.25.0",
|
||||
"d3": "^3.5.5",
|
||||
"enzyme": "^3.3.0",
|
||||
"enzyme-adapter-react-16": "^1.1.1",
|
||||
"enzyme-adapter-react-16": "^1.15.1",
|
||||
"extract-text-webpack-plugin": "^4.0.0-beta.0",
|
||||
"fbemitter": "^2.1.1",
|
||||
"file-loader": "^0.9.0",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import L from 'leaflet';
|
||||
import ReactDOM from 'ReactDOM';
|
||||
import ReactDOM from 'react-dom';
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import './Contours.scss';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import L from 'leaflet';
|
||||
import ReactDOM from 'ReactDOM';
|
||||
import ReactDOM from 'react-dom';
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import './ElevationMap.scss';
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'leaflet-measure-ex/dist/leaflet-measure';
|
|||
import 'leaflet-measure-ex/dist/leaflet-measure.css';
|
||||
import MeasurePopup from './MeasurePopup';
|
||||
import Utils from 'webodm/classes/Utils';
|
||||
import ReactDOM from 'ReactDOM';
|
||||
import ReactDOM from 'react-dom';
|
||||
import React from 'react';
|
||||
import $ from 'jquery';
|
||||
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
let webpack = require('webpack');
|
||||
let WebpackDevServer = require('webpack-dev-server');
|
||||
let config = require('./webpack.config');
|
||||
//ajax code
|
||||
new WebpackDevServer(webpack(config), {
|
||||
publicPath: config.output.publicPath,
|
||||
hot: true,
|
||||
inline: true
|
||||
}).listen(3000, '0.0.0.0', (err, result) => {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
}
|
||||
|
||||
console.log('Listening at 0.0.0.0:3000');
|
||||
})
|
|
@ -89,8 +89,8 @@ module.exports = {
|
|||
// on the global let jQuery
|
||||
"jquery": "jQuery",
|
||||
"SystemJS": "SystemJS",
|
||||
"React": "React",
|
||||
"ReactDOM": "ReactDOM"
|
||||
"react": "React",
|
||||
"react-dom": "ReactDOM"
|
||||
},
|
||||
|
||||
watchOptions: {
|
||||
|
|
Ładowanie…
Reference in New Issue