11import { mount } from '@vue/test-utils'
2- import { createContainer , waitNT , waitRAF } from '../../../tests/utils'
2+ import { waitNT , waitRAF } from '../../../tests/utils'
33import { BCarousel } from './carousel'
44import { BCarouselSlide } from './carousel-slide'
55
@@ -34,7 +34,7 @@ const App = {
3434describe ( 'carousel' , ( ) => {
3535 it ( 'has expected default structure' , async ( ) => {
3636 const wrapper = mount ( BCarousel , {
37- attachTo : createContainer ( )
37+ attachTo : document . body
3838 } )
3939
4040 expect ( wrapper . vm ) . toBeDefined ( )
@@ -101,7 +101,7 @@ describe('carousel', () => {
101101
102102 it ( 'has prev/next controls when prop controls is set' , async ( ) => {
103103 const wrapper = mount ( BCarousel , {
104- attachTo : createContainer ( ) ,
104+ attachTo : document . body ,
105105 propsData : {
106106 controls : true
107107 }
@@ -164,7 +164,7 @@ describe('carousel', () => {
164164
165165 it ( 'has indicators showing when prop indicators is set' , async ( ) => {
166166 const wrapper = mount ( BCarousel , {
167- attachTo : createContainer ( ) ,
167+ attachTo : document . body ,
168168 propsData : {
169169 indicators : true
170170 }
@@ -211,7 +211,7 @@ describe('carousel', () => {
211211
212212 it ( 'should have class "carousel-fade" when prop "fade" is "true"' , async ( ) => {
213213 const wrapper = mount ( BCarousel , {
214- attachTo : createContainer ( ) ,
214+ attachTo : document . body ,
215215 propsData : {
216216 fade : true
217217 }
@@ -230,7 +230,7 @@ describe('carousel', () => {
230230
231231 it ( 'should not have class "fade" or "slide" when prop "no-animation" is "true"' , async ( ) => {
232232 const wrapper = mount ( BCarousel , {
233- attachTo : createContainer ( ) ,
233+ attachTo : document . body ,
234234 propsData : {
235235 noAnimation : true
236236 }
@@ -249,7 +249,7 @@ describe('carousel', () => {
249249
250250 it ( 'should not have class "fade" or "slide" when prop "no-animation" and "fade" are "true"' , async ( ) => {
251251 const wrapper = mount ( BCarousel , {
252- attachTo : createContainer ( ) ,
252+ attachTo : document . body ,
253253 propsData : {
254254 fade : true ,
255255 noAnimation : true
@@ -269,7 +269,7 @@ describe('carousel', () => {
269269
270270 it ( 'should not automatically scroll to next slide when "interval" is "0"' , async ( ) => {
271271 const wrapper = mount ( App , {
272- attachTo : createContainer ( ) ,
272+ attachTo : document . body ,
273273 propsData : {
274274 interval : 0
275275 }
@@ -296,7 +296,7 @@ describe('carousel', () => {
296296
297297 it ( 'should scroll to next/prev slide when next/prev clicked' , async ( ) => {
298298 const wrapper = mount ( App , {
299- attachTo : createContainer ( ) ,
299+ attachTo : document . body ,
300300 propsData : {
301301 interval : 0 ,
302302 controls : true
@@ -358,7 +358,7 @@ describe('carousel', () => {
358358
359359 it ( 'should scroll to next/prev slide when next/prev space keypress' , async ( ) => {
360360 const wrapper = mount ( App , {
361- attachTo : createContainer ( ) ,
361+ attachTo : document . body ,
362362 propsData : {
363363 interval : 0 ,
364364 controls : true
@@ -420,7 +420,7 @@ describe('carousel', () => {
420420
421421 it ( 'should scroll to specified slide when indicator clicked' , async ( ) => {
422422 const wrapper = mount ( App , {
423- attachTo : createContainer ( ) ,
423+ attachTo : document . body ,
424424 propsData : {
425425 interval : 0 ,
426426 controls : true
@@ -482,7 +482,7 @@ describe('carousel', () => {
482482
483483 it ( 'should scroll to specified slide when indicator keypress space/enter' , async ( ) => {
484484 const wrapper = mount ( App , {
485- attachTo : createContainer ( ) ,
485+ attachTo : document . body ,
486486 propsData : {
487487 interval : 0 ,
488488 controls : true
@@ -544,7 +544,7 @@ describe('carousel', () => {
544544
545545 it ( 'should scroll to next/prev slide when key next/prev pressed' , async ( ) => {
546546 const wrapper = mount ( App , {
547- attachTo : createContainer ( ) ,
547+ attachTo : document . body ,
548548 propsData : {
549549 interval : 0 ,
550550 controls : true
@@ -603,7 +603,7 @@ describe('carousel', () => {
603603
604604 it ( 'should emit paused and unpaused events when "interval" changed to 0' , async ( ) => {
605605 const wrapper = mount ( App , {
606- attachTo : createContainer ( ) ,
606+ attachTo : document . body ,
607607 propsData : {
608608 interval : 0
609609 }
@@ -682,7 +682,7 @@ describe('carousel', () => {
682682
683683 it ( 'should scroll to specified slide when value (v-model) changed' , async ( ) => {
684684 const wrapper = mount ( App , {
685- attachTo : createContainer ( ) ,
685+ attachTo : document . body ,
686686 propsData : {
687687 interval : 0 ,
688688 value : 0
@@ -761,7 +761,7 @@ describe('carousel', () => {
761761
762762 it ( 'changing slides works when "no-animation" set' , async ( ) => {
763763 const wrapper = mount ( App , {
764- attachTo : createContainer ( ) ,
764+ attachTo : document . body ,
765765 propsData : {
766766 interval : 0 ,
767767 noAnimation : true
@@ -825,7 +825,7 @@ describe('carousel', () => {
825825
826826 it ( 'setting new slide when sliding is active, schedules the new slide to happen after finished' , async ( ) => {
827827 const wrapper = mount ( App , {
828- attachTo : createContainer ( ) ,
828+ attachTo : document . body ,
829829 propsData : {
830830 interval : 0
831831 }
@@ -902,7 +902,7 @@ describe('carousel', () => {
902902
903903 it ( 'next/prev slide wraps to end/start when "no-wrap is "false"' , async ( ) => {
904904 const wrapper = mount ( App , {
905- attachTo : createContainer ( ) ,
905+ attachTo : document . body ,
906906 propsData : {
907907 interval : 0 ,
908908 noAnimation : true ,
@@ -967,7 +967,7 @@ describe('carousel', () => {
967967
968968 it ( 'next/prev slide does not wrap to end/start when "no-wrap" is "true"' , async ( ) => {
969969 const wrapper = mount ( App , {
970- attachTo : createContainer ( ) ,
970+ attachTo : document . body ,
971971 propsData : {
972972 interval : 0 ,
973973 // Transitions (or fallback timers) are not used when no-animation set
0 commit comments