mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-27 13:29:15 +07:00
🐛 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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user