import { describe, expect, it } from "vitest";

describe("mNotify credentials", () => {
  it("accepts the configured API key at the documented account endpoint", async () => {
    const apiKey = process.env.MNOTIFY_API_KEY;
    expect(apiKey, "MNOTIFY_API_KEY must be configured for this validation").toBeTruthy();

    const response = await fetch(
      `https://api.mnotify.com/api/template?key=${encodeURIComponent(apiKey ?? "")}`,
      { method: "GET", signal: AbortSignal.timeout(10_000) },
    );

    expect(response.status).not.toBe(401);
    expect(response.status).not.toBe(403);
    expect(response.ok).toBe(true);
  }, 15_000);
});

