/**
 * TEAM: frontend_infra
 * @flow
 */
// TODO: Fix this eslint issue on next edit. This is an autogenerated comment.
// eslint-disable-next-line flexport/no-legacy-dependencies
import {mount} from "enzyme";

import Badge from "../Badge";
import Text from "../Text";

describe("Badge", () => {
  describe("can render a flag", () => {
    it("works as expected", () => {
      expect(mount(<Badge />).length).toEqual(1);
    });
    it("when count exceeds max, a plus character is added", () => {
      const badge = mount(<Badge value={100} max={99} />);

      expect(badge.find(Text).props().children).toEqual("99+");
    });
  });
});
