test(core): increase coverage for sessions, auth choice, and model listing

This commit is contained in:
Peter Steinberger
2026-02-22 14:06:11 +00:00
parent d116bcfb14
commit 9f2b25426b
9 changed files with 360 additions and 288 deletions

View File

@@ -260,6 +260,23 @@ describe("models list/status", () => {
return parseJsonLog(runtime);
}
const GOOGLE_ANTIGRAVITY_OPUS_46_CASES = [
{
name: "thinking",
configuredModelId: "claude-opus-4-6-thinking",
templateId: "claude-opus-4-5-thinking",
templateName: "Claude Opus 4.5 Thinking",
expectedKey: "google-antigravity/claude-opus-4-6-thinking",
},
{
name: "non-thinking",
configuredModelId: "claude-opus-4-6",
templateId: "claude-opus-4-5",
templateName: "Claude Opus 4.5",
expectedKey: "google-antigravity/claude-opus-4-6",
},
] as const;
function expectAntigravityModel(
payload: Record<string, unknown>,
params: { key: string; available: boolean; includesTags?: boolean },
@@ -329,22 +346,7 @@ describe("models list/status", () => {
expect(payload.models[0]?.available).toBe(false);
});
it.each([
{
name: "thinking",
configuredModelId: "claude-opus-4-6-thinking",
templateId: "claude-opus-4-5-thinking",
templateName: "Claude Opus 4.5 Thinking",
expectedKey: "google-antigravity/claude-opus-4-6-thinking",
},
{
name: "non-thinking",
configuredModelId: "claude-opus-4-6",
templateId: "claude-opus-4-5",
templateName: "Claude Opus 4.5",
expectedKey: "google-antigravity/claude-opus-4-6",
},
] as const)(
it.each(GOOGLE_ANTIGRAVITY_OPUS_46_CASES)(
"models list resolves antigravity opus 4.6 $name from 4.5 template",
async ({ configuredModelId, templateId, templateName, expectedKey }) => {
const payload = await runGoogleAntigravityListCase({
@@ -360,22 +362,7 @@ describe("models list/status", () => {
},
);
it.each([
{
name: "thinking",
configuredModelId: "claude-opus-4-6-thinking",
templateId: "claude-opus-4-5-thinking",
templateName: "Claude Opus 4.5 Thinking",
expectedKey: "google-antigravity/claude-opus-4-6-thinking",
},
{
name: "non-thinking",
configuredModelId: "claude-opus-4-6",
templateId: "claude-opus-4-5",
templateName: "Claude Opus 4.5",
expectedKey: "google-antigravity/claude-opus-4-6",
},
] as const)(
it.each(GOOGLE_ANTIGRAVITY_OPUS_46_CASES)(
"models list marks synthesized antigravity opus 4.6 $name as available when template is available",
async ({ configuredModelId, templateId, templateName, expectedKey }) => {
const payload = await runGoogleAntigravityListCase({