From 6f29d7211e0d6fec049301002c787de159202afc Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 22 Nov 2016 13:26:39 -0800 Subject: [PATCH] Move restore/unmaximize specs near state ones --- spec/api-browser-window-spec.js | 59 ++++++++++++++++----------------- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index f18322bbf40a..f7aa6436a47c 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -1320,6 +1320,34 @@ describe('browser-window module', function () { }) }) + describe('BrowserWindow.restore()', function () { + it('should restore the previous window size', function () { + if (w != null) w.destroy() + + w = new BrowserWindow({ + minWidth: 800, + width: 800 + }) + + const initialSize = w.getSize() + w.minimize() + w.restore() + assertBoundsEqual(w.getSize(), initialSize) + }) + }) + + describe('BrowserWindow.unmaximize()', function () { + it('should restore the previous window position', function () { + if (w != null) w.destroy() + w = new BrowserWindow() + + const initialPosition = w.getPosition() + w.maximize() + w.unmaximize() + assertBoundsEqual(w.getPosition(), initialPosition) + }) + }) + describe('parent window', function () { let c = null @@ -1754,37 +1782,6 @@ describe('browser-window module', function () { }) }) }) - - describe('Restoring the window', function () { - beforeEach(function () { - if (w != null) w.destroy() - w = new BrowserWindow({ - minWidth: 800, - width: 800 - }) - }) - - it('should restore the correct bounds when minWidth is used', function () { - const initialSize = w.getSize() - w.minimize() - w.restore() - assertBoundsEqual(w.getSize(), initialSize) - }) - }) - - describe('Unmaximizing the window', function () { - beforeEach(function () { - if (w != null) w.destroy() - w = new BrowserWindow() - }) - - it('should set the correct position', function () { - const initialPosition = w.getPosition() - w.maximize() - w.unmaximize() - assertBoundsEqual(w.getPosition(), initialPosition) - }) - }) }) const assertBoundsEqual = (actual, expect) => {