import {
  afterEach,
  describe,
  globalExpect,
  init_dist,
  it
} from "../../chunk-D6N3USMR.mjs";
import {
  BlindPay,
  init_client
} from "../../chunk-VWWGGMMT.mjs";
import "../../chunk-FG25JHDX.mjs";
import "../../chunk-KMU6V4LW.mjs";
import "../../chunk-QGNLMN6Z.mjs";
import "../../chunk-ISHZTBAN.mjs";
import "../../chunk-UDRMLZWT.mjs";
import "../../chunk-LEPGLH7Q.mjs";
import "../../chunk-UC57SCKQ.mjs";
import "../../chunk-E7M4CJKR.mjs";
import "../../chunk-F5Z45GCA.mjs";
import "../../chunk-TBTA7A2P.mjs";
import "../../chunk-YIZJM2GU.mjs";
import "../../chunk-Z6EYX4D3.mjs";
import "../../chunk-ALHMJWQN.mjs";
import "../../chunk-B5T7AQLH.mjs";
import "../../chunk-RC5NN5UF.mjs";
import "../../chunk-VGU72ZNI.mjs";
import "../../chunk-LRHWT4JU.mjs";
import "../../chunk-WE73MTQL.mjs";
import "../../chunk-UOAM7SX3.mjs";
import {
  __async,
  __commonJS
} from "../../chunk-OBKEW4AQ.mjs";

// src/resources/available/available.test.ts
var require_available_test = __commonJS({
  "src/resources/available/available.test.ts"(exports) {
    init_dist();
    init_client();
    describe("Available", () => {
      afterEach(() => fetchMock.resetMocks());
      const blindpay = new BlindPay({ apiKey: "test-key", instanceId: "in_000000000000" });
      describe("Get bank details", () => {
        it("should get bank details for a rail", () => __async(null, null, function* () {
          const mockedBankDetails = [
            {
              label: "Account Type",
              regex: "",
              key: "account_type",
              items: [
                {
                  label: "Checking",
                  value: "checking"
                },
                {
                  label: "Savings",
                  value: "saving"
                }
              ],
              required: true
            }
          ];
          fetchMock.mockResponseOnce(JSON.stringify(mockedBankDetails), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.available.getBankDetails("pix");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedBankDetails);
        }));
      });
      describe("Get rails", () => {
        it("should get available rails", () => __async(null, null, function* () {
          const mockedRails = [
            {
              label: "Domestic Wire",
              value: "wire",
              country: "US"
            },
            {
              label: "ACH",
              value: "ach",
              country: "US"
            },
            {
              label: "PIX",
              value: "pix",
              country: "BR"
            },
            {
              label: "SPEI",
              value: "spei_bitso",
              country: "MX"
            },
            {
              label: "Transfers 3.0",
              value: "transfers_bitso",
              country: "AR"
            },
            {
              label: "ACH Colombia",
              value: "ach_cop_bitso",
              country: "CO"
            },
            {
              label: "International Swift",
              value: "international_swift",
              country: "US"
            },
            {
              label: "RTP",
              value: "rtp",
              country: "US"
            }
          ];
          fetchMock.mockResponseOnce(JSON.stringify(mockedRails), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.available.getRails();
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedRails);
        }));
      });
      describe("Get NAICS codes", () => {
        it("should get available NAICS codes", () => __async(null, null, function* () {
          const mockedNaicsCodes = [
            {
              label: "Software Publishers",
              value: "511210"
            },
            {
              label: "Computer Systems Design Services",
              value: "541512"
            },
            {
              label: "Data Processing, Hosting, and Related Services",
              value: "518210"
            }
          ];
          fetchMock.mockResponseOnce(JSON.stringify(mockedNaicsCodes), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.available.getNaicsCodes();
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedNaicsCodes);
        }));
      });
      describe("Get swift code bank details", () => {
        it("should get bank details of a swift code", () => __async(null, null, function* () {
          const mockedBankDetails = [
            {
              id: "416",
              bank: "BANK OF AMERICA, N.A.",
              city: "NEW JERSEY",
              branch: "LENDING SERVICES AND OPERATIONS (LSOP)",
              swiftCode: "BOFAUS3NLMA",
              swiftCodeLink: "https://bank.codes/swift-code/united-states/bofaus3nlma/",
              country: "United States",
              countrySlug: "united-states"
            }
          ];
          fetchMock.mockResponseOnce(JSON.stringify(mockedBankDetails), {
            headers: {
              "Content-Type": "application/json"
            }
          });
          const { data, error } = yield blindpay.available.getSwiftCodeBankDetails("BOFAUS3NLMA");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedBankDetails);
        }));
      });
    });
  }
});
export default require_available_test();
