ELECTRON-651 (Assign focused window to the screen picker) [Windows] (#468)

* ELECTRON-651 - Assign focused window to the screen picker

which disables user interaction with the content below

* ELECTRON-651 - Fix jest-html-reporter's path in jest config

* ELECTRON-651 - Fix unit tests
This commit is contained in:
Kiran Niranjan
2018-08-20 17:35:40 +05:30
committed by Vishwas Shashidhar
parent 9dba7521fc
commit 5a0576402c
4 changed files with 12 additions and 8 deletions

View File

@@ -79,6 +79,10 @@ function openScreenPickerWindow(eventSender, sources, id) {
windowConfig.x = Math.round(centerX - (windowWidth / 2.0)); windowConfig.x = Math.round(centerX - (windowWidth / 2.0));
windowConfig.y = Math.round(centerY - (windowHeight / 2.0)); windowConfig.y = Math.round(centerY - (windowHeight / 2.0));
} }
if (isWindowsOS) {
windowConfig.parent = focusedWindow;
}
} }
// Store the window ref to send event // Store the window ref to send event

View File

@@ -70,11 +70,11 @@ const ipcRenderer = {
}; };
module.exports = { module.exports = {
require: jest.genMockFunction(), require: jest.fn(),
match: jest.genMockFunction(), match: jest.fn(),
app: jest.genMockFunction(), app: jest.fn(),
ipcMain: ipcMain, ipcMain: ipcMain,
ipcRenderer: ipcRenderer, ipcRenderer: ipcRenderer,
remote: jest.genMockFunction(), remote: jest.fn(),
dialog: jest.genMockFunction() dialog: jest.fn()
}; };

View File

@@ -270,7 +270,7 @@ describe('read/write config tests', function() {
return updateConfigField('url2', 'hello world') return updateConfigField('url2', 'hello world')
.catch(function (err) { .catch(function (err) {
expect(err).toThrow(err); expect(err.message).toBe('Path must be a string. Received null');
}); });
}); });
@@ -309,7 +309,7 @@ describe('read/write config tests', function() {
return saveUserConfig('url2', 'hello world') return saveUserConfig('url2', 'hello world')
.catch(function (err) { .catch(function (err) {
expect(err).toThrow(err); expect(err.message).toBe('Path must be a string. Received null');
}); });
}); });

View File

@@ -1,6 +1,6 @@
{ {
"testMatch": ["**/*.test.js"], "testMatch": ["**/*.test.js"],
"verbose": true, "verbose": true,
"testResultsProcessor": "./node_modules/jest-html-reporter" "testResultsProcessor": "../node_modules/jest-html-reporter"
} }