Move restore/unmaximize specs near state ones

This commit is contained in:
Kevin Sawicki 2016-11-22 13:26:39 -08:00
parent 63eec70350
commit 6f29d7211e

View file

@ -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) => {