test: dedupe gemini oauth fallback checks

This commit is contained in:
Peter Steinberger 2026-03-13 22:10:10 +00:00
parent b4719455bc
commit ccd763aef7
1 changed files with 11 additions and 18 deletions

View File

@ -275,16 +275,16 @@ describe("loginGeminiCliOAuth", () => {
}); });
} }
async function runRemoteLoginWithCapturedAuthUrl( type LoginGeminiCliOAuthFn = (options: {
loginGeminiCliOAuth: (options: { isRemote: boolean;
isRemote: boolean; openUrl: () => Promise<void>;
openUrl: () => Promise<void>; log: (msg: string) => void;
log: (msg: string) => void; note: () => Promise<void>;
note: () => Promise<void>; prompt: () => Promise<string>;
prompt: () => Promise<string>; progress: { update: () => void; stop: () => void };
progress: { update: () => void; stop: () => void }; }) => Promise<{ projectId: string }>;
}) => Promise<{ projectId: string }>,
) { async function runRemoteLoginWithCapturedAuthUrl(loginGeminiCliOAuth: LoginGeminiCliOAuthFn) {
let authUrl = ""; let authUrl = "";
const result = await loginGeminiCliOAuth({ const result = await loginGeminiCliOAuth({
isRemote: true, isRemote: true,
@ -306,14 +306,7 @@ describe("loginGeminiCliOAuth", () => {
} }
async function runRemoteLoginExpectingProjectId( async function runRemoteLoginExpectingProjectId(
loginGeminiCliOAuth: (options: { loginGeminiCliOAuth: LoginGeminiCliOAuthFn,
isRemote: boolean;
openUrl: () => Promise<void>;
log: (msg: string) => void;
note: () => Promise<void>;
prompt: () => Promise<string>;
progress: { update: () => void; stop: () => void };
}) => Promise<{ projectId: string }>,
projectId: string, projectId: string,
) { ) {
const { result } = await runRemoteLoginWithCapturedAuthUrl(loginGeminiCliOAuth); const { result } = await runRemoteLoginWithCapturedAuthUrl(loginGeminiCliOAuth);