[UNSTABLE] Fix two tests. `render()` related, mostly

pull/511/head
Rick Carlino 2017-10-22 09:56:21 -05:00
parent b5f0d67a2e
commit f06f01c837
2 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,5 @@
jest.mock("farmbot-toastr", () => ({
fun: jest.fn(),
init: jest.fn(),
success: jest.fn(),
info: jest.fn(),

View File

@ -2,14 +2,14 @@ import * as React from "react";
import { SyncButton } from "../sync_button";
import { bot } from "../../__test_support__/fake_state/bot";
import { defensiveClone } from "../../util";
import { render } from "enzyme";
import { shallow } from "enzyme";
const FAKE_BOT_STATE = defensiveClone(bot);
describe("<SyncButton/>", function () {
it("renders nothing when not given a bot", function () {
const dispatcher = jest.fn();
const result = render(<SyncButton user={undefined}
const result = shallow(<SyncButton user={undefined}
dispatch={dispatcher}
bot={FAKE_BOT_STATE} />);
expect(result.hasClass("nav-sync")).toBeFalsy();