Add spec for maximize restore positioning
This commit is contained in:
parent
621a934160
commit
926cabec78
1 changed files with 19 additions and 2 deletions
|
@ -1755,7 +1755,7 @@ describe('browser-window module', function () {
|
|||
})
|
||||
})
|
||||
|
||||
describe.only('minWidth', function () {
|
||||
describe('minWidth', function () {
|
||||
beforeEach(function () {
|
||||
if (w != null) w.destroy()
|
||||
w = new BrowserWindow({
|
||||
|
@ -1764,7 +1764,7 @@ describe('browser-window module', function () {
|
|||
})
|
||||
})
|
||||
|
||||
it('should persist when restoring the window', function (done) {
|
||||
it('should not affect the bounds when restoring the window', function (done) {
|
||||
w.minimize();
|
||||
setTimeout(() => {
|
||||
w.restore();
|
||||
|
@ -1773,6 +1773,23 @@ describe('browser-window module', function () {
|
|||
}, 200);
|
||||
})
|
||||
})
|
||||
|
||||
describe.only('window position', function () {
|
||||
beforeEach(function () {
|
||||
if (w != null) w.destroy()
|
||||
w = new BrowserWindow()
|
||||
})
|
||||
|
||||
it('should not affect the bounds when restoring the window', function (done) {
|
||||
const originalPos = w.getPosition();
|
||||
w.maximize();
|
||||
setTimeout(() => {
|
||||
w.unmaximize();
|
||||
assertBoundsEqual(originalPos, w.getPosition());
|
||||
done();
|
||||
}, 200);
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
const assertBoundsEqual = (actual, expect) => {
|
||||
|
|
Loading…
Reference in a new issue