mirror of https://github.com/openclaw/openclaw.git
test: dedupe gemini oauth fallback checks
This commit is contained in:
parent
b4719455bc
commit
ccd763aef7
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue