test(ts): add types

This commit is contained in:
moklick
2022-09-13 14:52:51 +02:00
parent 1da2630167
commit 132886f5e9
5 changed files with 68 additions and 62 deletions
@@ -47,9 +47,9 @@ describe('<ReactFlow />: Event handlers', () => {
expect(onNodeDragStop.callCount).to.be.eq(0);
cy.drag('.react-flow__node:first', { x: 200, y: 0 }).then(() => {
expect(onNodeDragStart.callCount).to.be.eq(1);
expect(onNodeDrag.callCount).to.be.eq(1);
expect(onNodeDragStop.callCount).to.be.eq(1);
expect(onNodeDragStart.callCount).to.be.gt(0);
expect(onNodeDrag.callCount).to.be.gt(0);
expect(onNodeDragStop.callCount).to.be.gt(0);
});
});
});
@@ -178,11 +178,13 @@ describe('<ReactFlow />: Event handlers', () => {
expect(onMove.callCount).to.be.eq(0);
expect(onMoveEnd.callCount).to.be.eq(0);
cy.dragPane({ from: { x: 10, y: 200 }, to: { x: 100, y: 200 } }).then(() => {
expect(onMoveStart.callCount).to.be.eq(1);
expect(onMove.callCount).to.be.gt(0);
expect(onMoveEnd.callCount).to.be.eq(1);
});
cy.dragPane({ from: { x: 10, y: 200 }, to: { x: 100, y: 200 } })
.wait(100)
.then(() => {
expect(onMoveStart.callCount).to.be.eq(1);
expect(onMove.callCount).to.be.gt(0);
expect(onMoveEnd.callCount).to.be.eq(1);
});
});
});
@@ -197,6 +199,7 @@ describe('<ReactFlow />: Event handlers', () => {
cy.get('.react-flow__pane')
.rightclick()
.click()
.wait(100)
.then(() => {
expect(onPaneClick.callCount).to.be.eq(1);
expect(onPaneContextMenu.callCount).to.be.eq(1);
+5 -1
View File
@@ -103,6 +103,10 @@ const routes = [
path: '/nodetypesobject-change',
component: NodeTypesObjectChange,
},
{
path: '/overview',
component: Overview,
},
{
path: '/provider',
component: Provider,
@@ -174,7 +178,7 @@ const Header = () => {
<select defaultValue={location.pathname} onChange={onChange}>
{routes.map((route) => (
<option value={route.path} key={route.path}>
{route.path === '/' ? 'overview' : route.path.substring(1, route.path.length)}
{route.path === '/' ? 'basic' : route.path.substring(1, route.path.length)}
</option>
))}
</select>
+3 -2
View File
@@ -14,8 +14,9 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
"jsx": "react-jsx",
"types": ["cypress", "cypress-real-events"]
},
"include": ["src"],
"include": ["**/*.ts", "**/*.tsx"],
"references": [{ "path": "./tsconfig.node.json" }]
}