import {
  BeepClient
} from "../chunk-RHRRSHUY.mjs";
import "../chunk-IUPPETLC.mjs";
import "../chunk-3AWHWPXV.mjs";
import "../chunk-EE7I5JHK.mjs";
import "../chunk-7Q5QQCHS.mjs";
import "../chunk-6DZX6EAA.mjs";
import "../chunk-YPAFAKCO.mjs";

// tests/integration.test.ts
describe.skip("Integration Tests", () => {
  let client;
  beforeAll(() => {
    client = new BeepClient({
      apiKey: process.env.BEEP_API_KEY || "test-api-key",
      serverUrl: process.env.BEEP_API_URL || "https://34351e6fd33a.ngrok-free.app"
    });
  });
  it("healthCheck should return health status", async () => {
    const health = await client.healthCheck();
    expect(health).toBeDefined();
  });
  it("requestPayment creates a valid invoice", async () => {
    const invoice = await client.requestPayment({
      amount: 0.01,
      // Small amount for testing
      token: "USDT" /* USDT */,
      description: "Integration test payment",
      payerType: "customer_wallet"
    });
    console.log("Invoice created in requestPayment:", invoice);
    expect(invoice).toBeDefined();
    expect(invoice.invoiceId).toBeDefined();
  });
  it("payments module can create and retrieve a product", async () => {
    const product = await client.payments.createProduct({
      name: `Test Product ${Date.now()}`,
      // Unique name
      description: "Created by integration test",
      price: "0.01",
      token: "USDT" /* USDT */,
      isSubscription: false
    });
    expect(product).toBeDefined();
    expect(product.id).toBeDefined();
    const retrievedProduct = await client.payments.getProduct(product.id);
    expect(retrievedProduct).toBeDefined();
    expect(retrievedProduct.id).toBe(product.id);
    await client.payments.deleteProduct(product.id);
  });
  it("payments module should create and get an invoice", async () => {
    const product = await client.payments.createProduct({
      name: "Integration Test Product",
      price: "0.01",
      token: "USDT" /* USDT */,
      description: "Test product for integration tests"
    });
    const invoice = await client.payments.createInvoice({
      productId: product.id,
      payerType: "customer_wallet"
    });
    console.log("Invoice created:", invoice);
    expect(invoice).toBeDefined();
    expect(invoice.id).toBeDefined();
    const invoiceId = invoice.id;
    expect(invoiceId).toBeDefined();
    const retrievedInvoice = await client.payments.getInvoice(invoiceId);
    console.log("Invoice retrieved:", retrievedInvoice);
    expect(retrievedInvoice.id).toBe(invoiceId);
    await client.payments.deleteInvoice(invoiceId);
  }, 1e4);
});
