diff --git a/src/ItemViewAppBar.test.js b/src/ItemViewAppBar.test.js new file mode 100644 index 0000000..4218681 --- /dev/null +++ b/src/ItemViewAppBar.test.js @@ -0,0 +1,25 @@ +import React from "react"; +import { render, unmountComponentAtNode} from "react-dom"; +import { act } from "react-dom/test-utils"; + +import ItemViewAppBar from "./ItemViewAppBar"; + +let container = null; +beforeEach(() => { + //Setup a DOM element as a render target + container = document.createElement("div"); + document.body.appendChild(container); +}); + +afterEach(() => { + unmountComponentAtNode(container); + container.remove(); + container = null; +}); + +it("renders only with a title", () =>{ + act(() => { + render(, container); + }) + expect(container.ItemViewAppBar).toBe(null); +}) \ No newline at end of file diff --git a/src/components/ItemViewAppBar/ItemViewAppBar.js b/src/components/ItemViewAppBar/ItemViewAppBar.js index a150cd6..9ae4957 100644 --- a/src/components/ItemViewAppBar/ItemViewAppBar.js +++ b/src/components/ItemViewAppBar/ItemViewAppBar.js @@ -18,7 +18,7 @@ export default function ItemViewAppBar(props){ return( <> - +