LandingPage Tests - Zoom

This commit is contained in:
Ben Mitchinson committed 2020-04-06 17:24:24 -05:00
1 parent e3a426ce64
commit b4c8eedeca
3 files changed
+22 -9

No files matched your search

+6 -6
View File
@@ -1,15 +1,15 @@
import React from 'react';
import './scss/App.scss';
import './antd-mobile.css';
import React from "react";
import "./scss/App.scss";
import "./antd-mobile.css";
import Login from './components/Login'
import Login from "./components/Login";
const App = () => {
return (
<>
<Login/>
<Login />
</>
);
}
};
export default App;
+11
View File
@@ -0,0 +1,11 @@
import React from "react";
import { render } from "@testing-library/react";
import LandingPage from "./LandingPage";
test("renders learn react link", () => {
const { getByText } = render(<LandingPage />);
const lookupButtonElement = getByText(/Patient Lookup/i);
const newPatientButtonElement = getByText(/New Patient/i);
expect(lookupButtonElement).toBeInTheDocument();
expect(newPatientButtonElement).toBeInTheDocument();
});
+5 -3
View File
@@ -1,14 +1,16 @@
import React, { ReactElement } from "react";
import { WhiteSpace, Button } from "antd-mobile";
import Icon, {UserAddOutlined} from "@ant-design/icons";
import Icon, { UserAddOutlined } from "@ant-design/icons";
import "../scss/LandingPage.scss";
export default function Login(): ReactElement {
export default function LandingPage(): ReactElement {
/* istanbul ignore next */
const patientLookup = () => {
console.log("Clicked Patient Lookup");
};
/* istanbul ignore next */
const newPatient = () => {
console.log("Clicked New Patient");
};
@@ -22,7 +24,7 @@ export default function Login(): ReactElement {
</div>
<br />
<div id="buttonFlex">
<Button icon={<UserAddOutlined/>}onClick={newPatient}>
<Button icon={<UserAddOutlined />} onClick={newPatient}>
New Patient
</Button>
<WhiteSpace />