import React from "react";
import { shallow } from "enzyme";
import ApiInfo, { PureApiInfo } from "../components/util/ApiInfo";

jest.mock("../domain/apiMethods");

describe("ApiInfo", () => {
  it("renders", () => {
    const rendered = shallow(<ApiInfo />);
    expect(rendered).toMatchSnapshot();
  });

  describe("PureApiInfo", () => {
    it("renders", () => {
      const rendered = shallow(<PureApiInfo status="healthy" version="test" />);
      expect(rendered).toMatchSnapshot();
    });

    it("renders for unhealthy", () => {
      const rendered = shallow(<PureApiInfo status="bad" version="test" />);
      expect(rendered).toMatchSnapshot();
    });
  });
});
