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/instances/instances.test.ts
var require_instances_test = __commonJS({
  "src/resources/instances/instances.test.ts"(exports) {
    init_dist();
    init_client();
    describe("Instances", () => {
      afterEach(() => fetchMock.resetMocks());
      const blindpay = new BlindPay({ apiKey: "test-key", instanceId: "in_000000000000" });
      describe("Get instance members", () => {
        it("should get instance members", () => __async(null, null, function* () {
          const mockedMembers = [
            {
              id: "us_000000000000",
              email: "email@example.com",
              first_name: "Harry",
              middle_name: "James",
              last_name: "Potter",
              image_url: "https://example.com/image.png",
              created_at: "2021-01-01T00:00:00Z",
              role: "admin"
            }
          ];
          fetchMock.mockResponseOnce(JSON.stringify(mockedMembers), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.instances.getMembers();
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedMembers);
        }));
      });
      describe("Update instance", () => {
        it("should update an instance", () => __async(null, null, function* () {
          fetchMock.mockResponseOnce(JSON.stringify({ data: null }), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.instances.update({
            name: "New Instance Name"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual({ data: null });
        }));
      });
      describe("Delete instance", () => {
        it("should delete an instance", () => __async(null, null, function* () {
          fetchMock.mockResponseOnce(JSON.stringify({ data: null }), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.instances.delete();
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual({ data: null });
        }));
      });
      describe("Delete instance member", () => {
        it("should delete an instance member", () => __async(null, null, function* () {
          fetchMock.mockResponseOnce(JSON.stringify({ data: null }), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.instances.deleteMember("us_000000000000");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual({ data: null });
        }));
      });
      describe("Update instance member role", () => {
        it("should update instance member role", () => __async(null, null, function* () {
          fetchMock.mockResponseOnce(JSON.stringify({ data: null }), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.instances.updateMemberRole({
            memberId: "us_000000000000",
            role: "checker"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual({ data: null });
        }));
      });
    });
  }
});
export default require_instances_test();
