fix: compensate for title bar height when setting bounds on BrowserView (#34713)

fix: compensate for title bar height when setting bounds
This commit is contained in:
Shelley Vohr 2022-08-29 17:53:03 +02:00 committed by GitHub
parent d0e220cbce
commit 75f9573e53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 9 deletions

View file

@ -146,7 +146,14 @@ describe('BrowserView module', () => {
});
describe('BrowserView.getBounds()', () => {
it('returns the current bounds', () => {
it('returns correct bounds on a framed window', () => {
view = new BrowserView();
const bounds = { x: 10, y: 20, width: 30, height: 40 };
view.setBounds(bounds);
expect(view.getBounds()).to.deep.equal(bounds);
});
it('returns correct bounds on a frameless window', () => {
view = new BrowserView();
const bounds = { x: 10, y: 20, width: 30, height: 40 };
view.setBounds(bounds);