mirror of
https://github.com/Kong/insomnia
synced 2024-11-07 22:30:15 +00:00
Test improvements (#103)
* Fixed duplication kve bug * Some extra testing stuff * A few fixes
This commit is contained in:
parent
1c5166d27e
commit
46e2cd51d8
1
app/__mocks__/dummy.js
Normal file
1
app/__mocks__/dummy.js
Normal file
@ -0,0 +1 @@
|
||||
module.exports = {};
|
7
app/__tests__/renderer.test.js
Normal file
7
app/__tests__/renderer.test.js
Normal file
@ -0,0 +1,7 @@
|
||||
import * as renderer from '../renderer';
|
||||
|
||||
describe('imports', () => {
|
||||
it('ui module should import successfully', () => {
|
||||
expect(renderer).toBeDefined();
|
||||
});
|
||||
});
|
@ -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 = {
|
||||
|
@ -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,
|
||||
|
@ -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__/**",
|
||||
|
Loading…
Reference in New Issue
Block a user