Commit 6797e1a5 authored by Martin Fahl's avatar Martin Fahl

fixes mocks for test cases

parent 3bea09ad
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`App should render as expected 1`] = `
<div
className="App"
>
<div
name="Navbar"
/>
<div
className="container"
>
<div
name="InventoryList"
/>
</div>
<footer
className="page-footer mt-4 blue font-small pt-4 mt-4 text-center"
>
<div
className="container-fluid"
>
Created with
<span
aria-label="Heart"
role="img"
>
❤️
</span>
in
2018
by
<a
href="https://www.codecentric.de"
rel="noopener noreferrer"
target="_blank"
>
codecentric
</a>
</div>
</footer>
</div>
`;
import React from "react";
export const Filter = () => <div name="Filter" />
import React from "react";
import InventoryList from "./InventoryList";
import renderer from "react-test-renderer";
import { shallow } from "enzyme";
jest.mock("../Filter/Filter", () => ({
Filter: () => <div name="Filter" />
}));
jest.mock("../../container/ItemContainer/ItemContainer", () => ({
Item: () => <div name="Item" />
}));
jest.mock('../Filter/Filter')
jest.mock('../../container/ItemContainer/ItemContainer')
describe("InventoryList", () => {
it("should render as expected", () => {
......
......@@ -21,11 +21,7 @@ exports[`InventoryList should render as expected 1`] = `
/>
<ul
className="list-group"
>
<div
name="Item"
/>
</ul>
/>
</div>
</div>
</div>
......
import React from "react";
export const Item = () => <div name="Item" />
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Item should render as expected 1`] = `
<li
className="list-group-item"
>
<div
className="row"
>
<div
className="col-4 col-md-6"
>
Water
</div>
<div
className="col-8 col-md-6"
>
<span
className="badge secondary badge-secondary ml-1 mr-1"
onClick={[Function]}
>
<i
aria-hidden="true"
className="fa fa-minus-square"
/>
</span>
<span
className="badge default badge-default badge-pill ml-1 mr-1"
/>
<span
className="badge secondary badge-secondary ml-1 mr-1"
onClick={[Function]}
>
<i
aria-hidden="true"
className="fa fa-plus-square"
/>
</span>
<span
className="badge danger badge-danger ml-1 mr-1"
onClick={[Function]}
>
<i
aria-hidden="true"
className="fa fa-trash"
/>
</span>
</div>
</div>
</li>
`;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment