Farmbot-Web-App/frontend/__tests__/apology_test.tsx

15 lines
418 B
TypeScript

jest.mock("../session", () => ({ Session: { clear: jest.fn() } }));
import * as React from "react";
import { mount } from "enzyme";
import { Apology } from "../apology";
import { Session } from "../session";
describe("<Apology />", () => {
it("clears session", () => {
const wrapper = mount(<Apology />);
wrapper.find("a").first().simulate("click");
expect(Session.clear).toHaveBeenCalled();
});
});