More UI tests, transform properties ES6 plugin setup

pull/295/head
Piero Toffanin 2017-09-05 13:12:35 -04:00
rodzic fb73197a0b
commit 5a3c87fbf6
11 zmienionych plików z 71 dodań i 4 usunięć

Wyświetl plik

@ -1,3 +1,10 @@
{
"presets": ["es2015", "react"]
"presets": ["es2015", "react"],
"env": {
"test": {
"plugins": ["syntax-class-properties",
"transform-class-properties"]
}
}
}

Wyświetl plik

@ -4,6 +4,7 @@ import './vendor/google-code-prettify/prettify';
import './vendor/google-code-prettify/prettify.css';
import update from 'immutability-helper';
import Utils from './classes/Utils';
import $ from 'jquery';
class Console extends React.Component {
constructor(props){

Wyświetl plik

@ -0,0 +1,10 @@
import React from 'react';
import { shallow } from 'enzyme';
import AssetDownloadButtons from '../AssetDownloadButtons';
describe('<AssetDownloadButtons />', () => {
it('renders without exploding', () => {
const wrapper = shallow(<AssetDownloadButtons task={{project: 1, id: 1, available_assets: ["orthophoto.tif", "dsm.tif"]}} />);
expect(wrapper.exists()).toBe(true);
})
});

Wyświetl plik

@ -0,0 +1,12 @@
import React from 'react';
import { shallow } from 'enzyme';
import EditPresetDialog from '../EditPresetDialog';
describe('<EditPresetDialog />', () => {
it('renders without exploding', () => {
const wrapper = shallow(<EditPresetDialog
/>);
expect(wrapper.exists()).toBe(true);
})
});

Wyświetl plik

@ -0,0 +1,10 @@
import React from 'react';
import { shallow } from 'enzyme';
import Console from '../Console';
describe('<Console />', () => {
it('renders without exploding', () => {
const wrapper = shallow(<Console />);
expect(wrapper.exists()).toBe(true);
})
});

Wyświetl plik

@ -1,3 +1,4 @@
import React from 'react';
import { shallow } from 'enzyme';
import Dashboard from '../Dashboard';

Wyświetl plik

@ -0,0 +1,10 @@
import React from 'react';
import { shallow } from 'enzyme';
import MapView from '../MapView';
describe('<MapView />', () => {
it('renders without exploding', () => {
const wrapper = shallow(<MapView mapItems={[{mapType: "orthophoto", tiles: ["/tiles.json"]}]} />);
expect(wrapper.exists()).toBe(true);
})
});

Wyświetl plik

@ -0,0 +1,13 @@
import React from 'react';
import { shallow } from 'enzyme';
// import ModelView from '../ModelView';
// TODO: this needs some debugging since Potree has troubles with requirements
describe('<ModelView />', () => {
it('TODO: renders without exploding', () => {
expect(true).toBe(true);
// const wrapper = shallow(<ModelView task={{id: 1, project: 1}} />);
// expect(wrapper.exists()).toBe(true);
})
});

Wyświetl plik

@ -3,4 +3,6 @@
Currently we don't transpile SCSS files when
testing with Jest. We might want to change
this in the future if we start doing snapshot
testing */
testing */
export default {};

Wyświetl plik

@ -1,6 +1,7 @@
module.exports = {
roots: ["./app/static/app/js"],
"moduleNameMapper": {
"^.*\\.scss$": "./tests/mocks/empty.scss.js" // TODO: how to use an absolute path?
"^.*\\.s?css$": "<rootDir>/app/static/app/js/tests/mocks/empty.scss.js",
"jquery": "<rootDir>/app/static/app/js/vendor/jquery-1.11.2.min.js"
}
};

Wyświetl plik

@ -1,5 +1,5 @@
{
"name": "webodm",
"name": "WebODM",
"version": "0.4.0",
"description": "Open Source Drone Image Processing",
"main": "index.js",