Skip to content

Commit

Permalink
fixed objectSpread not transform to runtime import
Browse files Browse the repository at this point in the history
  • Loading branch information
HillLiu committed Dec 12, 2019
1 parent bdc11e0 commit 2233aa4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions babel.config.js
Expand Up @@ -50,6 +50,7 @@ module.exports = function(api) {
{
regenerator: false,
useESModules: true,
version: "7.5.0",
},
],
'@babel/plugin-proposal-export-default-from',
Expand Down
2 changes: 1 addition & 1 deletion packages/organism-react-graph/package.json
@@ -1,6 +1,6 @@
{
"name": "organism-react-graph",
"version": "0.2.0",
"version": "0.2.1",
"description": "React Graph",
"repository": "react-atomic/react-atomic-organism",
"main": "./build/cjs/src/index.js",
Expand Down
3 changes: 1 addition & 2 deletions packages/organism-react-graph/ui/molecules/DragAndDrop.jsx
Expand Up @@ -33,7 +33,6 @@ class DragAndDrop extends PureComponent {
handleDrag = () => {
const {x, y, dx, dy, sourceEvent} = d3Event();
const thisEvent = unifyTouch(sourceEvent);
const {fromX, fromY} = this.start;
const {absX, absY, onDrag, zoom} = this.props;
const zoomK = get(callfunc(zoom), ['k'], 1);
const nextAbsX = absX + dx / zoomK;
Expand All @@ -48,7 +47,7 @@ class DragAndDrop extends PureComponent {
thisEvent.absX = nextAbsX;
thisEvent.absY = nextAbsY;
this.last = thisEvent;
callfunc(onDrag, [thisEvent]);
callfunc(onDrag, [thisEvent, this.start]);
};

handleEnd = () => {
Expand Down
@@ -0,0 +1,17 @@
import React from 'react';

import {expect} from 'chai';
import {shallow, mount, configure} from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new Adapter() });

import DragAndDrop from '../DragAndDrop';

describe('Test DragAndDrop', ()=>{
it('base test', ()=>{
const Comp = ({onGetEl}) => <div ref={onGetEl} />
const uDom = mount(<DragAndDrop component={Comp} />);
const html = uDom.html();
expect(html).to.have.string('div');
});
});

0 comments on commit 2233aa4

Please sign in to comment.