fix(mosaic): gateway token recovery review remediations (#414)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/push/publish Pipeline was successful

This commit was merged in pull request #414.
This commit is contained in:
2026-04-05 06:13:29 +00:00
parent 3abd63ea5c
commit 119ff0eb1b
5 changed files with 90 additions and 30 deletions

View File

@@ -16,14 +16,9 @@ vi.mock('./daemon.js', () => ({
vi.mock('./login.js', () => ({
getGatewayUrl: vi.fn().mockReturnValue('http://localhost:14242'),
}));
// Mock readline so tests don't block on stdin
vi.mock('node:readline', () => ({
createInterface: vi.fn().mockReturnValue({
question: vi.fn((_q: string, cb: (a: string) => void) => cb('test-input')),
close: vi.fn(),
}),
// promptLine/promptSecret are used by ensureSession; return fixed values so tests don't block on stdin
promptLine: vi.fn().mockResolvedValue('test@example.com'),
promptSecret: vi.fn().mockResolvedValue('test-password'),
}));
const mockFetch = vi.fn();