Move restore/unmaximize specs near state ones
This commit is contained in:
parent
63eec70350
commit
6f29d7211e
1 changed files with 28 additions and 31 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue