🐛 fix: restore getBounds mock in Browser test beforeEach (#11254)

Fix failing close event handling tests by restoring the getBounds mock
return value in beforeEach after vi.clearAllMocks(). The issue occurred
because clearAllMocks() removed the getBounds mock behavior set during
hoisting, causing x and y coordinates to be undefined instead of 0.
This commit is contained in:
Innei
2026-01-05 20:25:32 +08:00
committed by GitHub
parent 5d307c5042
commit 56fe3d33bc

View File

@@ -133,6 +133,7 @@ describe('Browser', () => {
vi.useFakeTimers();
// Reset mock behaviors
mockBrowserWindow.getBounds.mockReturnValue({ height: 600, width: 800, x: 0, y: 0 });
mockBrowserWindow.isDestroyed.mockReturnValue(false);
mockBrowserWindow.isVisible.mockReturnValue(true);
mockBrowserWindow.isFocused.mockReturnValue(true);