@@ -596,34 +596,38 @@ describeWithShallowAndMount('options.stub', mountingMethod => {
596
596
delete Vue . options . components [ 'child-component' ]
597
597
} )
598
598
599
- it ( 'renders props in the element as attributes' , ( ) => {
600
- const ComponentStub = { template : '<div id="component-stub" />' }
601
- const StringStub = '<div id="string-stub" />'
602
- const BooleanStub = true
599
+ itRunIf (
600
+ vueVersion < 2.2 ,
601
+ 'renders props in the element as attributes' ,
602
+ ( ) => {
603
+ const ComponentStub = { template : '<div id="component-stub" />' }
604
+ const StringStub = '<div id="string-stub" />'
605
+ const BooleanStub = true
603
606
604
- const wrapper = mountingMethod ( ComponentWithNestedChildrenAndAttributes , {
605
- stubs : {
606
- SlotComponent : ComponentStub ,
607
- ChildComponent : StringStub ,
608
- OriginalComponent : BooleanStub
609
- }
610
- } )
607
+ const wrapper = mountingMethod ( ComponentWithNestedChildrenAndAttributes , {
608
+ stubs : {
609
+ SlotComponent : ComponentStub ,
610
+ ChildComponent : StringStub ,
611
+ OriginalComponent : BooleanStub
612
+ }
613
+ } )
611
614
612
- expect ( wrapper . find ( '#component-stub' ) . attributes ( ) ) . to . eql ( {
613
- id : 'component-stub' ,
614
- prop1 : 'foobar' ,
615
- prop2 : 'fizzbuzz'
616
- } )
617
- expect ( wrapper . find ( '#string-stub' ) . attributes ( ) ) . to . eql ( {
618
- id : 'string-stub' ,
619
- prop1 : 'foobar' ,
620
- prop2 : 'fizzbuzz'
621
- } )
622
- expect ( wrapper . find ( 'originalcomponent-stub' ) . attributes ( ) ) . to . eql ( {
623
- prop1 : 'foobar' ,
624
- prop2 : 'fizzbuzz'
625
- } )
626
- } )
615
+ expect ( wrapper . find ( '#component-stub' ) . attributes ( ) ) . to . eql ( {
616
+ id : 'component-stub' ,
617
+ prop1 : 'foobar' ,
618
+ prop2 : 'fizzbuzz'
619
+ } )
620
+ expect ( wrapper . find ( '#string-stub' ) . attributes ( ) ) . to . eql ( {
621
+ id : 'string-stub' ,
622
+ prop1 : 'foobar' ,
623
+ prop2 : 'fizzbuzz'
624
+ } )
625
+ expect ( wrapper . find ( 'originalcomponent-stub' ) . attributes ( ) ) . to . eql ( {
626
+ prop1 : 'foobar' ,
627
+ prop2 : 'fizzbuzz'
628
+ } )
629
+ }
630
+ )
627
631
628
632
it ( 'warns when passing a string' , ( ) => {
629
633
const StringComponent = '<div></div>'
@@ -639,4 +643,13 @@ describeWithShallowAndMount('options.stub', mountingMethod => {
639
643
)
640
644
)
641
645
} )
646
+
647
+ it ( 'doesnt work' , ( ) => {
648
+ const StringComponent = 'Hello'
649
+ mountingMethod ( ComponentWithChild , {
650
+ stubs : {
651
+ ChildComponent6 : StringComponent
652
+ }
653
+ } )
654
+ } )
642
655
} )
0 commit comments