test: draggable region allows moving window (#41127)

* chore: add nut.js

* test: dragging window updates position

* instantly move mouse position

* limit platforms to run drag tests on

* defer loading nut-js
This commit is contained in:
Sam Maddock 2024-01-31 04:29:17 -05:00 committed by GitHub
parent fb88375ab4
commit 85bebfb180
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 841 additions and 6 deletions

View file

@ -91,3 +91,16 @@ export const areColorsSimilar = (
const distance = colorDistance(hexColorA, hexColorB);
return distance <= distanceThreshold;
};
/**
* Whether the current VM has a valid screen which can be used to capture.
*
* This is specific to Electron's CI test runners.
* - Linux: virtual screen display is 0x0
* - Win32 arm64 (WOA): virtual screen display is 0x0
* - Win32 ia32: skipped
*/
export const hasCapturableScreen = () => {
return process.platform === 'darwin' ||
(process.platform === 'win32' && process.arch === 'x64');
};