|
4 | 4 |
|
5 | 5 | import Vue from 'vue'
|
6 | 6 | import Promise from 'promise-polyfill'
|
7 |
| -import {assert, expect} from 'chai' |
| 7 | +import { assert, expect } from 'chai' |
8 | 8 | import * as HOOKS from '../../utilities/hooks'
|
9 |
| -import {nodeLength} from '../../utilities/helpers' |
| 9 | +import { nodeLength } from '../../utilities/helpers' |
10 | 10 |
|
11 | 11 | Vue.config.productionTip = false
|
12 | 12 |
|
13 | 13 | describe('Calling "alert()"', function () {
|
14 |
| - let dg |
| 14 | + let dg |
15 | 15 |
|
16 |
| - before(HOOKS.sanitizeAndPrepareWindow) |
17 |
| - before(function (done) { |
18 |
| - dg = window.vm.triggerAlert() |
19 |
| - Vue.nextTick(done) // be sure done has updated before proceeding |
20 |
| - }) |
| 16 | + before(HOOKS.sanitizeAndPrepareWindow) |
| 17 | + before(function (done) { |
| 18 | + dg = window.vm.triggerAlert() |
| 19 | + Vue.nextTick(done) // be sure done has updated before proceeding |
| 20 | + }) |
21 | 21 |
|
22 |
| - it('Should return a promise', function () { |
23 |
| - expect(dg).to.be.instanceOf(Promise) |
24 |
| - }) |
| 22 | + it('Should return a promise', function () { |
| 23 | + expect(dg).to.be.instanceOf(Promise) |
| 24 | + }) |
25 | 25 |
|
26 |
| - it('Should make the dialog visible', function () { |
27 |
| - assert.strictEqual(nodeLength('.dg-container'), 1) |
28 |
| - }) |
| 26 | + it('Should make the dialog visible', function () { |
| 27 | + assert.strictEqual(nodeLength('.dg-container'), 1) |
| 28 | + }) |
29 | 29 |
|
30 |
| - it('Should make the ok button visible', function () { |
31 |
| - assert.strictEqual(nodeLength('.dg-btn--ok'), 1) |
32 |
| - }) |
| 30 | + it('Should make the ok button visible', function () { |
| 31 | + assert.strictEqual(nodeLength('.dg-btn--ok'), 1) |
| 32 | + }) |
33 | 33 |
|
34 |
| - it('Should exclude the cancel button', function () { |
35 |
| - assert.strictEqual(nodeLength('.dg-btn--cancel'), 0) |
36 |
| - }) |
| 34 | + it('Should exclude the cancel button', function () { |
| 35 | + assert.strictEqual(nodeLength('.dg-btn--cancel'), 0) |
| 36 | + }) |
37 | 37 | })
|
38 | 38 |
|
39 | 39 | describe('Clicking "ok" on #alert()', function () {
|
40 |
| - before(HOOKS.sanitizeAndPrepareWindow) |
| 40 | + before(HOOKS.sanitizeAndPrepareWindow) |
41 | 41 |
|
42 |
| - it('Should resolve the promise', function (done) { |
43 |
| - window.vm.triggerAlert().then(() => {done()}) // expected |
44 |
| - Vue.nextTick(() => window.vm.clickDialogBtn('ok')) |
45 |
| - }) |
| 42 | + it('Should resolve the promise', function (done) { |
| 43 | + window.vm.triggerAlert().then(() => { done() }) // expected |
| 44 | + Vue.nextTick(() => window.vm.clickDialogBtn('ok')) |
| 45 | + }) |
46 | 46 | })
|
0 commit comments