git.fiddlerwoaroof.com
Browse code

Cleanup action-link and fragment

Ed Langley authored on 14/05/2019 07:56:34
Showing 3 changed files
... ...
@@ -1,4 +1,4 @@
1
-export const ActionLink = (React, PropTypes) => {
1
+const ActionLink = (React, PropTypes) => {
2 2
   function ActionLink({ action, children, ...props }, { store }) {
3 3
     const renderedRoute = store.pathForAction(action);
4 4
 
... ...
@@ -1,14 +1,13 @@
1
-import { ActionLink } from "../action-link";
2
-import { mount } from "enzyme";
1
+import { _internal } from "../action-link";
2
+import Enzyme, { mount } from "enzyme";
3 3
 import ezJson from "enzyme-to-json";
4
-import Enzyme from "enzyme";
5 4
 import Adapter from "enzyme-adapter-react-16";
6 5
 Enzyme.configure({ adapter: new Adapter() });
7 6
 
8 7
 import React from "react";
9 8
 import PropTypes from "prop-types";
10 9
 
11
-const Link = ActionLink(React, PropTypes);
10
+const Link = _internal.ActionLink(React, PropTypes);
12 11
 
13 12
 it("dispatches an action on click", () => {
14 13
   // given
... ...
@@ -1,8 +1,7 @@
1 1
 import React from "react";
2 2
 import Fragment from "../fragment";
3 3
 import ezJson from "enzyme-to-json";
4
-import { shallow } from "enzyme";
5
-import Enzyme from "enzyme";
4
+import Enzyme, { shallow } from "enzyme";
6 5
 import Adapter from "enzyme-adapter-react-16";
7 6
 Enzyme.configure({ adapter: new Adapter() });
8 7