chore: update test

This commit is contained in:
Jack Wotherspoon
2026-03-10 09:14:22 +01:00
parent e824cb897a
commit 89f2afef02

View File

@@ -85,6 +85,7 @@ describe('AuthDialog', () => {
props = {
config: {
isBrowserLaunchSuppressed: vi.fn().mockReturnValue(false),
getSessionId: vi.fn().mockReturnValue('test-session-id'),
} as unknown as Config,
settings: {
merged: {
@@ -357,6 +358,13 @@ describe('AuthDialog', () => {
.spyOn(process, 'exit')
.mockImplementation(() => undefined as never);
const logSpy = vi.spyOn(debugLogger, 'log').mockImplementation(() => {});
const originalSend = process.send;
process.send = vi.fn(
(_msg: unknown, callback?: (err: Error | null) => void) => {
if (callback) callback(null);
return true;
},
);
vi.mocked(props.config.isBrowserLaunchSuppressed).mockReturnValue(true);
mockedValidateAuthMethod.mockReturnValue(null);
@@ -376,6 +384,7 @@ describe('AuthDialog', () => {
exitSpy.mockRestore();
logSpy.mockRestore();
process.send = originalSend;
vi.useRealTimers();
unmount();
});