1
- import Alert from './alert'
1
+ import BAlert from './alert'
2
2
import { mount } from '@vue/test-utils'
3
3
4
4
describe ( 'alert' , ( ) => {
5
5
it ( 'hidden alert renders comment node' , async ( ) => {
6
- const wrapper = mount ( Alert )
6
+ const wrapper = mount ( BAlert )
7
7
expect ( wrapper . isVueInstance ( ) ) . toBe ( true )
8
8
await wrapper . vm . $nextTick ( )
9
9
expect ( wrapper . isEmpty ( ) ) . toBe ( true )
@@ -13,7 +13,7 @@ describe('alert', () => {
13
13
} )
14
14
15
15
it ( 'hidden alert (show = "0") renders comment node' , async ( ) => {
16
- const wrapper = mount ( Alert , {
16
+ const wrapper = mount ( BAlert , {
17
17
propsData : {
18
18
show : '0'
19
19
}
@@ -27,7 +27,7 @@ describe('alert', () => {
27
27
} )
28
28
29
29
it ( 'hidden alert (show = 0) renders comment node' , async ( ) => {
30
- const wrapper = mount ( Alert , {
30
+ const wrapper = mount ( BAlert , {
31
31
propsData : {
32
32
show : 0
33
33
}
@@ -41,7 +41,7 @@ describe('alert', () => {
41
41
} )
42
42
43
43
it ( 'visible alert has default class names and attributes' , async ( ) => {
44
- const wrapper = mount ( Alert , {
44
+ const wrapper = mount ( BAlert , {
45
45
propsData : {
46
46
show : true
47
47
}
@@ -65,7 +65,7 @@ describe('alert', () => {
65
65
} )
66
66
67
67
it ( 'visible alert (show = "") has default class names and attributes' , async ( ) => {
68
- const wrapper = mount ( Alert , {
68
+ const wrapper = mount ( BAlert , {
69
69
propsData : {
70
70
show : ''
71
71
}
@@ -89,7 +89,7 @@ describe('alert', () => {
89
89
} )
90
90
91
91
it ( 'visible alert has variant when prop variant is set' , async ( ) => {
92
- const wrapper = mount ( Alert , {
92
+ const wrapper = mount ( BAlert , {
93
93
propsData : {
94
94
show : true ,
95
95
variant : 'success'
@@ -110,7 +110,7 @@ describe('alert', () => {
110
110
} )
111
111
112
112
it ( 'renders content from default slot' , async ( ) => {
113
- const wrapper = mount ( Alert , {
113
+ const wrapper = mount ( BAlert , {
114
114
propsData : {
115
115
show : true
116
116
} ,
@@ -130,7 +130,7 @@ describe('alert', () => {
130
130
} )
131
131
132
132
it ( 'hidden alert shows when show prop set' , async ( ) => {
133
- const wrapper = mount ( Alert )
133
+ const wrapper = mount ( BAlert )
134
134
135
135
expect ( wrapper . isVueInstance ( ) ) . toBe ( true )
136
136
await wrapper . vm . $nextTick ( )
@@ -151,7 +151,7 @@ describe('alert', () => {
151
151
} )
152
152
153
153
it ( 'dismissible alert should have class alert-dismissible' , async ( ) => {
154
- const wrapper = mount ( Alert , {
154
+ const wrapper = mount ( BAlert , {
155
155
propsData : {
156
156
show : true ,
157
157
dismissible : true
@@ -168,7 +168,7 @@ describe('alert', () => {
168
168
} )
169
169
170
170
it ( 'dismissible alert should have close button' , async ( ) => {
171
- const wrapper = mount ( Alert , {
171
+ const wrapper = mount ( BAlert , {
172
172
propsData : {
173
173
show : true ,
174
174
dismissible : true
@@ -185,7 +185,7 @@ describe('alert', () => {
185
185
} )
186
186
187
187
it ( 'dismissible alert should have close button with custom aria-label' , async ( ) => {
188
- const wrapper = mount ( Alert , {
188
+ const wrapper = mount ( BAlert , {
189
189
propsData : {
190
190
show : true ,
191
191
dismissible : true ,
@@ -203,7 +203,7 @@ describe('alert', () => {
203
203
} )
204
204
205
205
it ( 'dismiss button click should close alert' , async ( ) => {
206
- const wrapper = mount ( Alert , {
206
+ const wrapper = mount ( BAlert , {
207
207
propsData : {
208
208
show : true ,
209
209
dismissible : true
@@ -234,13 +234,13 @@ describe('alert', () => {
234
234
} )
235
235
236
236
it ( 'should have class fade when prop fade=true' , async ( ) => {
237
- const wrapper = mount ( Alert , {
237
+ const wrapper = mount ( BAlert , {
238
238
propsData : {
239
239
show : true ,
240
240
fade : true
241
241
} ,
242
242
stubs : {
243
- // the builtin stub doesn't execute the transition hooks
243
+ // The builtin stub doesn't execute the transition hooks
244
244
// so we let it use the real transition component
245
245
transition : false
246
246
}
@@ -259,13 +259,13 @@ describe('alert', () => {
259
259
} )
260
260
261
261
it ( 'fade transition works' , async ( ) => {
262
- const wrapper = mount ( Alert , {
262
+ const wrapper = mount ( BAlert , {
263
263
propsData : {
264
264
show : false ,
265
265
fade : true
266
266
} ,
267
267
stubs : {
268
- // the builtin stub doesn't execute the transition hooks
268
+ // The builtin stub doesn't execute the transition hooks
269
269
// so we let it use the real transition component
270
270
transition : false
271
271
}
@@ -293,7 +293,7 @@ describe('alert', () => {
293
293
await wrapper . vm . $nextTick ( )
294
294
await new Promise ( resolve => requestAnimationFrame ( resolve ) )
295
295
296
- // dismissed wont be emitted unless dismissible=true or show is a number
296
+ // Dismissed won't be emitted unless dismissible=true or show is a number
297
297
expect ( wrapper . emitted ( 'dismissed' ) ) . not . toBeDefined ( )
298
298
299
299
expect ( wrapper . isEmpty ( ) ) . toBe ( true )
@@ -304,7 +304,7 @@ describe('alert', () => {
304
304
305
305
it ( 'dismiss countdown emits dismiss-count-down event' , async ( ) => {
306
306
jest . useFakeTimers ( )
307
- const wrapper = mount ( Alert , {
307
+ const wrapper = mount ( BAlert , {
308
308
propsData : {
309
309
show : 3
310
310
}
@@ -341,7 +341,7 @@ describe('alert', () => {
341
341
342
342
it ( 'dismiss countdown emits dismiss-count-down event when show is number as string' , async ( ) => {
343
343
jest . useFakeTimers ( )
344
- const wrapper = mount ( Alert , {
344
+ const wrapper = mount ( BAlert , {
345
345
propsData : {
346
346
show : '3'
347
347
}
@@ -378,7 +378,7 @@ describe('alert', () => {
378
378
379
379
it ( 'dismiss countdown handles when show value is changed' , async ( ) => {
380
380
jest . useFakeTimers ( )
381
- const wrapper = mount ( Alert , {
381
+ const wrapper = mount ( BAlert , {
382
382
propsData : {
383
383
show : 2
384
384
}
@@ -430,7 +430,7 @@ describe('alert', () => {
430
430
431
431
it ( 'dismiss countdown handles when alert dismissed early' , async ( ) => {
432
432
jest . useFakeTimers ( )
433
- const wrapper = mount ( Alert , {
433
+ const wrapper = mount ( BAlert , {
434
434
propsData : {
435
435
show : 2 ,
436
436
dismissible : true
0 commit comments