import {
  afterEach,
  describe,
  globalExpect,
  init_dist,
  it
} from "../../chunk-GCCHFONX.mjs";
import {
  BlindPay,
  init_client
} from "../../chunk-ZPGWM4VJ.mjs";
import "../../chunk-IZYPRCCV.mjs";
import "../../chunk-QGNLMN6Z.mjs";
import "../../chunk-UC57SCKQ.mjs";
import "../../chunk-TBTA7A2P.mjs";
import "../../chunk-BONN6PYB.mjs";
import "../../chunk-5XJJKYXE.mjs";
import "../../chunk-RC5NN5UF.mjs";
import "../../chunk-W7NJUABI.mjs";
import "../../chunk-E7M4CJKR.mjs";
import "../../chunk-3QQCDR3E.mjs";
import "../../chunk-LRHWT4JU.mjs";
import "../../chunk-QHMIK7U3.mjs";
import "../../chunk-64EFLUS3.mjs";
import "../../chunk-B5T7AQLH.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);
        }));
      });
    });
  }
});
export default require_available_test();
