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/upload/upload.test.ts
var require_upload_test = __commonJS({
  "src/resources/upload/upload.test.ts"(exports) {
    init_dist();
    init_client();
    describe("Upload", () => {
      afterEach(() => fetchMock.resetMocks());
      const blindpay = new BlindPay({ apiKey: "test-key", instanceId: "in_000000000000" });
      describe("Upload file", () => {
        it("should upload a file", () => __async(null, null, function* () {
          const mockedUpload = {
            file_url: "https://storage.blindpay.com/uploads/abc123.pdf"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedUpload), {
            headers: { "Content-Type": "application/json" }
          });
          const file = new Blob(["test content"], { type: "application/pdf" });
          const { data, error } = yield blindpay.upload.upload({
            file,
            bucket: "onboarding",
            instance_id: "in_000000000000"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedUpload);
        }));
        it("should upload a file without instance_id", () => __async(null, null, function* () {
          const mockedUpload = {
            file_url: "https://storage.blindpay.com/uploads/abc123.pdf"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedUpload), {
            headers: { "Content-Type": "application/json" }
          });
          const file = new Blob(["test content"], { type: "image/png" });
          const { data, error } = yield blindpay.upload.upload({
            file,
            bucket: "avatar"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedUpload);
        }));
      });
    });
  }
});
export default require_upload_test();
