File tree Expand file tree Collapse file tree 1 file changed +32
-2
lines changed Expand file tree Collapse file tree 1 file changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -572,11 +572,41 @@ describe('UNIT: Directives', function () {
572
572
describe ( 'component' , function ( ) {
573
573
574
574
it ( 'should work with no args' , function ( ) {
575
- assert . ok ( false )
575
+ var testId = 'component-test'
576
+ mock ( testId , '<div v-component="' + testId + '"></div>' )
577
+ var t = new Vue ( {
578
+ el : '#' + testId ,
579
+ scope : {
580
+ msg : '123'
581
+ } ,
582
+ components : {
583
+ 'component-test' : {
584
+ template : '<span>{{msg}}</span>'
585
+ }
586
+ }
587
+ } )
588
+ assert . strictEqual ( t . $el . querySelector ( 'span' ) . textContent , '123' )
576
589
} )
577
590
578
591
it ( 'should work with arg (passed-in model from parent)' , function ( ) {
579
- assert . ok ( false )
592
+ var testId = 'component-test-2'
593
+ mock ( testId , '<div v-component="' + testId + ':options.test"></div>' )
594
+ var t = new Vue ( {
595
+ el : '#' + testId ,
596
+ scope : {
597
+ options : {
598
+ test : {
599
+ msg : '123'
600
+ }
601
+ }
602
+ } ,
603
+ components : {
604
+ 'component-test-2' : {
605
+ template : '<span>{{model.msg}}</span>'
606
+ }
607
+ }
608
+ } )
609
+ assert . strictEqual ( t . $el . querySelector ( 'span' ) . textContent , '123' )
580
610
} )
581
611
582
612
} )
You can’t perform that action at this time.
0 commit comments