Add spec for maximize restore positioning

This commit is contained in:
Samuel Attard 2016-11-22 16:07:19 +11:00
parent 621a934160
commit 926cabec78
No known key found for this signature in database
GPG key ID: 273DC1869D8F13EF

View file

@ -1755,7 +1755,7 @@ describe('browser-window module', function () {
}) })
}) })
describe.only('minWidth', function () { describe('minWidth', function () {
beforeEach(function () { beforeEach(function () {
if (w != null) w.destroy() if (w != null) w.destroy()
w = new BrowserWindow({ 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(); w.minimize();
setTimeout(() => { setTimeout(() => {
w.restore(); w.restore();
@ -1773,6 +1773,23 @@ describe('browser-window module', function () {
}, 200); }, 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) => { const assertBoundsEqual = (actual, expect) => {