spec: convert IAP and GC specs to expect (#13272)
* spec: convert IAP and GC specs to expect * address review
This commit is contained in:
parent
994f613450
commit
b4cce8e240
2 changed files with 34 additions and 19 deletions
|
@ -1,8 +1,12 @@
|
|||
const {globalShortcut} = require('electron').remote
|
||||
|
||||
const assert = require('assert')
|
||||
const chai = require('chai')
|
||||
const dirtyChai = require('dirty-chai')
|
||||
const isCI = require('electron').remote.getGlobal('isCi')
|
||||
|
||||
const {expect} = chai
|
||||
chai.use(dirtyChai)
|
||||
|
||||
describe('globalShortcut module', () => {
|
||||
before(function () {
|
||||
if (isCI && process.platform === 'win32') {
|
||||
|
@ -17,16 +21,16 @@ describe('globalShortcut module', () => {
|
|||
it('can register and unregister accelerators', () => {
|
||||
const accelerator = 'CommandOrControl+A+B+C'
|
||||
|
||||
assert.equal(globalShortcut.isRegistered(accelerator), false)
|
||||
expect(globalShortcut.isRegistered(accelerator)).to.be.false()
|
||||
globalShortcut.register(accelerator, () => {})
|
||||
assert.equal(globalShortcut.isRegistered(accelerator), true)
|
||||
expect(globalShortcut.isRegistered(accelerator)).to.be.true()
|
||||
globalShortcut.unregister(accelerator)
|
||||
assert.equal(globalShortcut.isRegistered(accelerator), false)
|
||||
expect(globalShortcut.isRegistered(accelerator)).to.be.false()
|
||||
|
||||
assert.equal(globalShortcut.isRegistered(accelerator), false)
|
||||
expect(globalShortcut.isRegistered(accelerator)).to.be.false()
|
||||
globalShortcut.register(accelerator, () => {})
|
||||
assert.equal(globalShortcut.isRegistered(accelerator), true)
|
||||
expect(globalShortcut.isRegistered(accelerator)).to.be.true()
|
||||
globalShortcut.unregisterAll()
|
||||
assert.equal(globalShortcut.isRegistered(accelerator), false)
|
||||
expect(globalShortcut.isRegistered(accelerator)).to.be.false()
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue