diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index e34457cbc..5ac9537b9 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -2635,6 +2635,27 @@ + + created + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + deleted false diff --git a/client/package.json b/client/package.json index 8223defa3..6485f4584 100644 --- a/client/package.json +++ b/client/package.json @@ -54,6 +54,7 @@ ] }, "devDependencies": { + "@apollo/react-testing": "^3.1.3", "enzyme": "^3.11.0", "enzyme-adapter-react-16": "^1.15.2" } diff --git a/client/src/App/App.container.jsx b/client/src/App/App.container.jsx index b9d91afa1..fa2168fce 100644 --- a/client/src/App/App.container.jsx +++ b/client/src/App/App.container.jsx @@ -126,6 +126,8 @@ class AppContainer extends Component { //Init local state. } + componentWillUnmount() {} + render() { const { client, loaded } = this.state; diff --git a/client/src/App/App.test.js b/client/src/App/App.test.js index a754b201b..945ec6f4a 100644 --- a/client/src/App/App.test.js +++ b/client/src/App/App.test.js @@ -1,9 +1,18 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from './App'; +import React from "react"; +import ReactDOM from "react-dom"; +import App from "./App.container"; +import { MockedProvider } from "@apollo/react-testing"; +const div = document.createElement("div"); -it('renders without crashing', () => { - const div = document.createElement('div'); - ReactDOM.render(, div); +it("renders without crashing", () => { + ReactDOM.render( + + + , + div + ); +}); + +it("unmounts without crashing", () => { ReactDOM.unmountComponentAtNode(div); }); diff --git a/client/src/components/alert/alert.component.test.js b/client/src/components/alert/alert.component.test.js new file mode 100644 index 000000000..4e850158f --- /dev/null +++ b/client/src/components/alert/alert.component.test.js @@ -0,0 +1,11 @@ +import React from "react"; +import ReactDOM from "react-dom"; +import Alert from "./alert.component"; +import { MockedProvider } from "@apollo/react-testing"; +import { shallow } from "enzyme"; + +const div = document.createElement("div"); + +it("renders without crashing", () => { + shallow(); +}); diff --git a/client/src/components/jobs-available-new/jobs-available-new.component.jsx b/client/src/components/jobs-available-new/jobs-available-new.component.jsx index 76db9474e..b34e6c5fa 100644 --- a/client/src/components/jobs-available-new/jobs-available-new.component.jsx +++ b/client/src/components/jobs-available-new/jobs-available-new.component.jsx @@ -1,22 +1,29 @@ -import { Input, Table, Button, Icon, notification } from "antd"; +import { Input, Table, Button, Icon, notification, Modal } from "antd"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { alphaSort } from "../../utils/sorters"; import { DateTimeFormatter } from "../../utils/DateFormatter"; +import OwnerFindModalContainer from "../owner-find-modal/owner-find-modal.container"; export default function JobsAvailableComponent({ loading, data, refetch, deleteJob, - deleteAllNewJobs + deleteAllNewJobs, + insertNewJob, + setJobId, + estDataLazyLoad }) { const { t } = useTranslation(); + const [loadEstData, estData] = estDataLazyLoad; const [state, setState] = useState({ sortedInfo: {}, filteredInfo: { text: "" } }); + const [modalVisible, setModalVisible] = useState(false); + const handleTableChange = (pagination, filters, sorter) => { setState({ ...state, filteredInfo: filters, sortedInfo: sorter }); }; @@ -114,7 +121,10 @@ export default function JobsAvailableComponent({