Skip to content

Commit 3bfbe86

Browse files
committed
Fix _testUtils not defined error since window isn't defined
1 parent bc2d90a commit 3bfbe86

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

e2e/playwright/fixtures/fixtureSetup.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,7 @@ import { SceneFixture } from '@e2e/playwright/fixtures/sceneFixture'
2323
import { ToolbarFixture } from '@e2e/playwright/fixtures/toolbarFixture'
2424

2525
import { TEST_SETTINGS } from '@e2e/playwright/storageStates'
26-
import {
27-
assertElectron,
28-
getUtils,
29-
settingsToToml,
30-
setup,
31-
} from '@e2e/playwright/test-utils'
26+
import { getUtils, settingsToToml, setup } from '@e2e/playwright/test-utils'
3227

3328
export class AuthenticatedApp {
3429
public readonly page: Page
@@ -233,7 +228,9 @@ export class ElectronZoo {
233228
}, dims)
234229

235230
return this.evaluate(async (dims: { width: number; height: number }) => {
236-
assertElectron()
231+
if (!window.electron) {
232+
throw new Error('Electron not defined')
233+
}
237234
await window.electron?.resizeWindow(dims.width, dims.height)
238235
window.document.body.style.width = dims.width + 'px'
239236
window.document.body.style.height = dims.height + 'px'

e2e/playwright/test-utils.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,6 @@ export const commonPoints = {
6868
export const editorSelector = '[role="textbox"][data-language="kcl"]'
6969
type PaneId = 'variables' | 'code' | 'files' | 'logs'
7070

71-
export function assertElectron() {
72-
expect(window.electron).toBeDefined()
73-
}
74-
7571
export function runningOnLinux() {
7672
return process.platform === 'linux'
7773
}

0 commit comments

Comments
 (0)