Test improvements (#103)

* Fixed duplication kve bug

* Some extra testing stuff

* A few fixes
This commit is contained in:
Gregory Schier 2017-03-03 16:09:55 -08:00 committed by GitHub
parent 1c5166d27e
commit 46e2cd51d8
5 changed files with 18 additions and 4 deletions

1
app/__mocks__/dummy.js Normal file
View File

@ -0,0 +1 @@
module.exports = {};

View File

@ -0,0 +1,7 @@
import * as renderer from '../renderer';
describe('imports', () => {
it('ui module should import successfully', () => {
expect(renderer).toBeDefined();
});
});

View File

@ -305,9 +305,11 @@ function isAbove (monitor, component) {
const hoveredNode = ReactDOM.findDOMNode(component);
const hoveredTop = hoveredNode.getBoundingClientRect().top;
const height = hoveredNode.clientHeight;
const draggedTop = monitor.getSourceClientOffset().y;
return hoveredTop > draggedTop;
// NOTE: Not quite sure why it's height / 3 (seems to work)
return hoveredTop > draggedTop - (height / 3);
}
const dragTarget = {

View File

@ -12,8 +12,8 @@
flex-direction: row;
width: 100%;
padding-left: @padding-md;
margin-top: @padding-xs;
margin-bottom: @padding-xs;
padding-top: @padding-xs;
padding-bottom: @padding-xs;
box-sizing: border-box;
&.key-value-editor__row-wrapper--disabled .input,

View File

@ -40,14 +40,18 @@
"setupFiles": [
"./__jest__/setup.js"
],
"moduleNameMapper": {
"\\.(css|less|png)$": "<rootDir>/__mocks__/dummy.js"
},
"rootDir": "app",
"verbose": false,
"collectCoverage": false,
"collectCoverageFrom": [
"**/*.js",
"!**/*.min.js",
"!**/main.development.js",
"!**/static/**",
"!**/ui/**",
"!**/ui/components/**",
"!**/__fixtures__/**",
"!**/__tests__/**",
"!**/__jest__/**",