Try specs without setTimeout calls
This commit is contained in:
parent
238beb72ee
commit
c0d9175bc3
1 changed files with 9 additions and 15 deletions
|
@ -1755,7 +1755,7 @@ describe('browser-window module', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('minWidth', function () {
|
describe('Restoring the window', function () {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
if (w != null) w.destroy()
|
if (w != null) w.destroy()
|
||||||
w = new BrowserWindow({
|
w = new BrowserWindow({
|
||||||
|
@ -1764,30 +1764,24 @@ describe('browser-window module', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should not affect the bounds when restoring the window', function (done) {
|
it('should set the correct width when minWidth is used', function () {
|
||||||
w.minimize()
|
w.minimize()
|
||||||
setTimeout(() => {
|
|
||||||
w.restore()
|
w.restore()
|
||||||
assert.equal(w.getSize()[0], 800)
|
assert.equal(w.getSize()[0], 800)
|
||||||
done()
|
|
||||||
}, 200)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('window position', function () {
|
describe('Unmaximizing the window', function () {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
if (w != null) w.destroy()
|
if (w != null) w.destroy()
|
||||||
w = new BrowserWindow()
|
w = new BrowserWindow()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should not affect the bounds when restoring the window', function (done) {
|
it('should set the correct position', function () {
|
||||||
const originalPos = w.getPosition()
|
const initialPosition = w.getPosition()
|
||||||
w.maximize()
|
w.maximize()
|
||||||
setTimeout(() => {
|
|
||||||
w.unmaximize()
|
w.unmaximize()
|
||||||
assertBoundsEqual(originalPos, w.getPosition())
|
assertBoundsEqual(initialPosition, w.getPosition())
|
||||||
done()
|
|
||||||
}, 200)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue