fix: add a "set" trap to the "screen" module proxy (#26818)
This commit is contained in:
parent
d3b1566181
commit
e89b3ca1d1
2 changed files with 35 additions and 21 deletions
|
@ -2,6 +2,18 @@ import { expect } from 'chai';
|
|||
import { screen } from 'electron/main';
|
||||
|
||||
describe('screen module', () => {
|
||||
describe('methods reassignment', () => {
|
||||
it('works for a selected method', () => {
|
||||
const originalFunction = screen.getPrimaryDisplay;
|
||||
try {
|
||||
(screen as any).getPrimaryDisplay = () => null;
|
||||
expect(screen.getPrimaryDisplay()).to.be.null();
|
||||
} finally {
|
||||
screen.getPrimaryDisplay = originalFunction;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('screen.getCursorScreenPoint()', () => {
|
||||
it('returns a point object', () => {
|
||||
const point = screen.getCursorScreenPoint();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue