diff --git a/spec/basicAuth.spec.ts b/spec/basicAuth.spec.ts index f6cee8b8..b7a757fe 100644 --- a/spec/basicAuth.spec.ts +++ b/spec/basicAuth.spec.ts @@ -33,12 +33,13 @@ describe('basic auth', () => { }); it('should call submit login', () => { + const fakeEvent = { preventDefault: () => {} }; const { ipcRenderer } = require('./__mocks__/electron'); const spy: jest.SpyInstance = jest.spyOn(ipcRenderer, 'send'); const wrapper: ShallowWrapper = shallow(React.createElement(BasicAuth)); wrapper.find('#username').simulate('change', usernameTargetMock); wrapper.find('#password').simulate('change', passwordTargetMock); - wrapper.find('#basicAuth').simulate('submit'); + wrapper.find('#basicAuth').simulate('submit', fakeEvent); expect(spy).lastCalledWith('basic-auth-login', { ...usernameMock, ...passwordMock, diff --git a/src/app/window-handler.ts b/src/app/window-handler.ts index ddb174c5..81b75f25 100644 --- a/src/app/window-handler.ts +++ b/src/app/window-handler.ts @@ -1493,13 +1493,20 @@ export class WindowHandler { { width: 360, height: isMac ? 270 : 295, + alwaysOnTop: true, + skipTaskbar: true, + resizable: false, show: false, modal: true, - autoHideMenuBar: true, - resizable: false, + frame: false, + transparent: true, + fullscreenable: false, + acceptFirstMouse: true, }, { - devTools: isDevEnv, + sandbox: IS_SAND_BOXED, + nodeIntegration: IS_NODE_INTEGRATION_ENABLED, + devTools: true, }, ); opts.parent = window; diff --git a/src/renderer/components/basic-auth.tsx b/src/renderer/components/basic-auth.tsx index dedadf19..4ae5ed9e 100644 --- a/src/renderer/components/basic-auth.tsx +++ b/src/renderer/components/basic-auth.tsx @@ -19,7 +19,7 @@ const BASIC_AUTH_NAMESPACE = 'BasicAuth'; export default class BasicAuth extends React.Component<{}, IState> { private readonly eventHandlers = { onChange: (event) => this.change(event), - onSubmit: () => this.submit(), + onSubmit: (event) => this.submit(event), onClose: () => this.close(), }; @@ -140,7 +140,8 @@ export default class BasicAuth extends React.Component<{}, IState> { /** * Submits the form with provided username and password info */ - private submit(): void { + private submit(event): void { + event.preventDefault(); const { username, password } = this.state; if (username && password) { ipcRenderer.send('basic-auth-login', { username, password });