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 () {
572572 describe ( 'component' , function ( ) {
573573
574574 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' )
576589 } )
577590
578591 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' )
580610 } )
581611
582612 } )
You can’t perform that action at this time.
0 commit comments