File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -53,10 +53,15 @@ export const createWindow = async (dir?: string): Promise<void> => {
5353 height : ( isE2E ? 1140 : height ) ,
5454 frame : true ,
5555 webPreferences : {
56- preload : path . join ( __dirname , 'preload.js' )
57-
56+ preload : path . join ( __dirname , 'preload.js' ) ,
5857 } ,
5958 } ) ;
59+
60+ // For E2E tests on low-resolution CI machines, zoom out to fit more content
61+ if ( isE2E ) {
62+ mainWindow . webContents . setZoomFactor ( 0.5 ) ; // 50% zoom for E2E
63+ }
64+
6065 mainWindow . webContents . setWindowOpenHandler ( ( details ) => {
6166 shell . openExternal ( details . url ) ; // Open URL in user's browser.
6267 return { action : "deny" } ; // Prevent the app from opening the URL.
Original file line number Diff line number Diff line change @@ -64,13 +64,10 @@ export default (
6464 if ( focusedWindow ) {
6565 let factor = ( focusedWindow as BrowserWindow ) . webContents . getZoomFactor ( )
6666 console . log ( factor )
67- if ( factor > 1.25 ) {
67+ if ( factor > 0.1 ) {
6868 factor = factor - 0.25
69- ; ( focusedWindow as BrowserWindow ) . webContents . setZoomFactor ( factor )
70- } else {
71- ( focusedWindow as BrowserWindow ) . webContents . setZoomFactor ( 1 )
69+ ; ( focusedWindow as BrowserWindow ) . webContents . setZoomFactor ( Math . max ( 0.1 , factor ) )
7270 }
73-
7471 }
7572 }
7673 } ,
You can’t perform that action at this time.
0 commit comments