Skip to content

Commit 6f816c1

Browse files
author
xinfei1
committed
test case
1 parent a6f2c02 commit 6f816c1

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
"name": "react-grid-layout-between",
33
"version": "0.1.0",
44
"private": true,
5+
"scripts": {
6+
"start": "react-scripts start",
7+
"build": "react-scripts build",
8+
"test": "react-scripts test",
9+
"eject": "react-scripts eject"
10+
},
511
"dependencies": {
612
"lodash": "^4.17.13",
713
"mockjs": "^1.1.0",
@@ -11,12 +17,6 @@
1117
"react-dom": "^16.8.6",
1218
"react-scripts": "3.4.1"
1319
},
14-
"scripts": {
15-
"start": "react-scripts start",
16-
"build": "react-scripts build",
17-
"test": "react-scripts test",
18-
"eject": "react-scripts eject"
19-
},
2020
"eslintConfig": {
2121
"extends": "react-app"
2222
},

src/App.test.js

+17
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
33
import App from './App';
4+
import { collision } from './utils/collision';
45

56
it('renders without crashing', () => {
67
const div = document.createElement('div');
78
ReactDOM.render(<App />, div);
89
ReactDOM.unmountComponentAtNode(div);
910
});
11+
12+
test('collision interface', () => {
13+
const a = {
14+
gridx: 0,
15+
gridy: 0,
16+
width: 2,
17+
height: 1
18+
};
19+
const b = {
20+
gridx: 1,
21+
gridy: 0,
22+
width: 1,
23+
height: 1
24+
};
25+
expect(collision(a,b)).toEqual(true);
26+
});
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)