import fetchMock from "jest-fetch-mock";
import { getChains } from "../../src/services";

const chains = ["test", "test2", "test3", "test4"];

describe("API", () => {
  beforeEach(() => {
    fetchMock.resetMocks();
  });

  describe("getChains", () => {
    it("should return all supported chains", async () => {
      fetchMock.mockResponse(JSON.stringify(chains));

      const supportedChains = await getChains();

      expect(supportedChains).toHaveLength(4);
    });
  });
});
