use arrow functions

This commit is contained in:
Bala Clark 2015-07-18 17:59:21 +02:00
parent 0238164789
commit cb9b7e7c16

View file

@ -1,29 +1,29 @@
let assert = require('assert') let assert = require('assert')
let LoadIndicator = require('../../app/view/load-indicator') let LoadIndicator = require('../../app/view/load-indicator')
describe('LoadIndicator', function () { describe('LoadIndicator', () => {
it('should render on init', function () { it('should render on init', () => {
let indicator = new LoadIndicator() let indicator = new LoadIndicator()
assert.equal(indicator.el.outerHTML assert.equal(indicator.el.outerHTML
, '<div id="cb-loading-overlay" style="display: none; "></div>') , '<div id="cb-loading-overlay" style="display: none; "></div>')
}) })
it('should show', function () { it('should show', () => {
let indicator = new LoadIndicator() let indicator = new LoadIndicator()
assert.equal(indicator.el.style.display, 'none') assert.equal(indicator.el.style.display, 'none')
indicator.show() indicator.show()
assert.equal(indicator.el.style.display, 'block') assert.equal(indicator.el.style.display, 'block')
}) })
it('should hide', function () { it('should hide', () => {
let indicator = new LoadIndicator() let indicator = new LoadIndicator()
indicator.show() indicator.show()
indicator.hide() indicator.hide()
assert.equal(indicator.el.style.display, 'none') assert.equal(indicator.el.style.display, 'none')
}) })
it('should emit a "show" event', function (done) { it('should emit a "show" event', done => {
let indicator = new LoadIndicator() let indicator = new LoadIndicator()
indicator.on('show', function (e) { indicator.on('show', function (e) {
assert.deepEqual(indicator, e) assert.deepEqual(indicator, e)
@ -32,7 +32,7 @@ describe('LoadIndicator', function () {
indicator.show() indicator.show()
}) })
it('should emit a "hide" event', function (done) { it('should emit a "hide" event', done => {
let indicator = new LoadIndicator() let indicator = new LoadIndicator()
indicator.on('hide', function (e) { indicator.on('hide', function (e) {
assert.deepEqual(indicator, e) assert.deepEqual(indicator, e)