import { matchRoutes } from "react-router-dom";
import { describe, expect, it } from "vitest";
import { DEVFRONT_AUTH_CALLBACK_PATH } from "../lib/authConfig";
import { devFrontRoutes } from "./routes";

describe("devfront routes", () => {
  it("accepts the auth callback path used by the OIDC redirect URI", () => {
    const matches = matchRoutes(devFrontRoutes, DEVFRONT_AUTH_CALLBACK_PATH);

    expect(matches).not.toBeNull();
    expect(matches?.at(-1)?.route.path).toBe(DEVFRONT_AUTH_CALLBACK_PATH);
  });
});
