spec: Avoid calling setParentWindow for unrelated tests
This commit is contained in:
parent
85ba382027
commit
a6c4bf098b
1 changed files with 9 additions and 13 deletions
|
@ -841,7 +841,7 @@ describe('browser-window module', function () {
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
if (c != null) c.destroy()
|
if (c != null) c.destroy()
|
||||||
c = new BrowserWindow({show: false})
|
c = new BrowserWindow({show: false, parent: w})
|
||||||
})
|
})
|
||||||
|
|
||||||
afterEach(function () {
|
afterEach(function () {
|
||||||
|
@ -850,11 +850,6 @@ describe('browser-window module', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('parent option', function () {
|
describe('parent option', function () {
|
||||||
beforeEach(function () {
|
|
||||||
if (c != null) c.destroy()
|
|
||||||
c = new BrowserWindow({show: false, parent: w})
|
|
||||||
})
|
|
||||||
|
|
||||||
it('sets parent window', function () {
|
it('sets parent window', function () {
|
||||||
assert.equal(c.getParentWindow(), w)
|
assert.equal(c.getParentWindow(), w)
|
||||||
})
|
})
|
||||||
|
@ -875,6 +870,11 @@ describe('browser-window module', function () {
|
||||||
describe('win.setParentWindow(parent)', function () {
|
describe('win.setParentWindow(parent)', function () {
|
||||||
if (process.platform !== 'darwin') return
|
if (process.platform !== 'darwin') return
|
||||||
|
|
||||||
|
beforeEach(function () {
|
||||||
|
if (c != null) c.destroy()
|
||||||
|
c = new BrowserWindow({show: false})
|
||||||
|
})
|
||||||
|
|
||||||
it('sets parent window', function () {
|
it('sets parent window', function () {
|
||||||
assert.equal(w.getParentWindow(), null)
|
assert.equal(w.getParentWindow(), null)
|
||||||
assert.equal(c.getParentWindow(), null)
|
assert.equal(c.getParentWindow(), null)
|
||||||
|
@ -905,7 +905,6 @@ describe('browser-window module', function () {
|
||||||
describe('win.setModal(modal)', function () {
|
describe('win.setModal(modal)', function () {
|
||||||
it('disables parent window', function () {
|
it('disables parent window', function () {
|
||||||
assert.equal(w.isEnabled(), true)
|
assert.equal(w.isEnabled(), true)
|
||||||
c.setParentWindow(w)
|
|
||||||
c.setModal(true)
|
c.setModal(true)
|
||||||
assert.equal(w.isEnabled(), false)
|
assert.equal(w.isEnabled(), false)
|
||||||
})
|
})
|
||||||
|
@ -915,14 +914,12 @@ describe('browser-window module', function () {
|
||||||
assert.equal(w.isEnabled(), true)
|
assert.equal(w.isEnabled(), true)
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
c.setParentWindow(w)
|
|
||||||
c.setModal(true)
|
c.setModal(true)
|
||||||
c.close()
|
c.close()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('enables parent window when setting not modal', function () {
|
it('enables parent window when setting not modal', function () {
|
||||||
assert.equal(w.isEnabled(), true)
|
assert.equal(w.isEnabled(), true)
|
||||||
c.setParentWindow(w)
|
|
||||||
c.setModal(true)
|
c.setModal(true)
|
||||||
assert.equal(w.isEnabled(), false)
|
assert.equal(w.isEnabled(), false)
|
||||||
c.setModal(false)
|
c.setModal(false)
|
||||||
|
@ -930,8 +927,9 @@ describe('browser-window module', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('enables parent window when removing parent', function () {
|
it('enables parent window when removing parent', function () {
|
||||||
|
if (process.platform !== 'darwin') return
|
||||||
|
|
||||||
assert.equal(w.isEnabled(), true)
|
assert.equal(w.isEnabled(), true)
|
||||||
c.setParentWindow(w)
|
|
||||||
c.setModal(true)
|
c.setModal(true)
|
||||||
assert.equal(w.isEnabled(), false)
|
assert.equal(w.isEnabled(), false)
|
||||||
c.setParentWindow(null)
|
c.setParentWindow(null)
|
||||||
|
@ -939,10 +937,8 @@ describe('browser-window module', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('disables parent window recursively', function () {
|
it('disables parent window recursively', function () {
|
||||||
let c2 = new BrowserWindow({show: false})
|
let c2 = new BrowserWindow({show: false, parent: w})
|
||||||
c.setParentWindow(w)
|
|
||||||
c.setModal(true)
|
c.setModal(true)
|
||||||
c2.setParentWindow(w)
|
|
||||||
c2.setModal(true)
|
c2.setModal(true)
|
||||||
assert.equal(w.isEnabled(), false)
|
assert.equal(w.isEnabled(), false)
|
||||||
c.setModal(false)
|
c.setModal(false)
|
||||||
|
|
Loading…
Reference in a new issue