fix: BrowserView autoresizing conversion error (#42056)

This commit is contained in:
Shelley Vohr 2024-05-13 10:27:01 +02:00 committed by GitHub
parent 3ea3b0e8e1
commit c765d57265
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 24 additions and 5 deletions

View file

@ -1503,6 +1503,13 @@ describe('BrowserWindow module', () => {
expectBoundsEqual(w.getBounds(), fullBounds);
});
it('rounds non-integer bounds', () => {
w.setBounds({ x: 440.5, y: 225.1, width: 500.4, height: 400.9 });
const bounds = w.getBounds();
expect(bounds).to.deep.equal({ x: 441, y: 225, width: 500, height: 401 });
});
it('sets the window bounds with partial bounds', () => {
const fullBounds = { x: 440, y: 225, width: 500, height: 400 };
w.setBounds(fullBounds);