Farmbot-Web-App/webpack/password_reset/__tests__/on_init_test.ts
2017-10-16 08:18:57 -05:00

16 lines
446 B
TypeScript

jest.mock("react-dom", () => ({ render: jest.fn() }));
import { onInit } from "../on_init";
import { render } from "react-dom";
describe("onInit()", () => {
it("Attaches to a DOM element", async (done) => {
await onInit({}, jest.fn());
expect({}).toBeTruthy();
expect(render).toHaveBeenCalled();
const [calls] = (render as jest.Mock<{}>).mock.calls;
expect(calls[0].type.name).toBe("PasswordReset");
done();
});
});