mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-05 08:10:39 +00:00
Restrict the browser install flow to Anthropic, OpenAI, and Gemini, remove the unused install-time base URL surface, and reject openai_compatible with a stable 422 response. Also fix the finishing health poller so it only redirects after the server comes back healthy outside install mode instead of jumping early on transient restart failures.
38 lines
966 B
TypeScript
38 lines
966 B
TypeScript
import { describe, expect, test } from "bun:test";
|
|
|
|
import { shouldRedirectAfterHealthPoll } from "./install-flow";
|
|
|
|
describe("shouldRedirectAfterHealthPoll", () => {
|
|
test("waits when the health request fails", () => {
|
|
expect(shouldRedirectAfterHealthPoll({ kind: "error" })).toBe(false);
|
|
});
|
|
|
|
test("waits when the server returns a non-success status", () => {
|
|
expect(
|
|
shouldRedirectAfterHealthPoll({
|
|
kind: "response",
|
|
ok: false,
|
|
}),
|
|
).toBe(false);
|
|
});
|
|
|
|
test("waits while the server is still in install mode", () => {
|
|
expect(
|
|
shouldRedirectAfterHealthPoll({
|
|
kind: "response",
|
|
ok: true,
|
|
mode: "install",
|
|
}),
|
|
).toBe(false);
|
|
});
|
|
|
|
test("redirects only after the server returns success outside install mode", () => {
|
|
expect(
|
|
shouldRedirectAfterHealthPoll({
|
|
kind: "response",
|
|
ok: true,
|
|
mode: "normal",
|
|
}),
|
|
).toBe(true);
|
|
});
|
|
});
|