@@ -719,20 +719,38 @@ describe('TreeViewNode.vue', () => {
719719
720720 describe ( 'when childrenPropNames is specified' , ( ) => {
721721
722- beforeEach ( ( ) => {
723- let defaultProps = getDefaultPropsData ( ) ;
724- wrapper = createWrapper ( Object . assign ( defaultProps , {
725- childrenPropNames : [ 'nope' , 'children' ] ,
726- initialModel : generateNodes ( [ 'sf' , [ 's' , 's' ] ] , defaultProps . radioGroupValues ) [ 0 ]
727- } ) ) ;
728- } ) ;
722+ describe ( 'and a valid-children model property is specified' , ( ) => {
723+
724+ beforeEach ( ( ) => {
725+ let defaultProps = getDefaultPropsData ( ) ;
726+ wrapper = createWrapper ( Object . assign ( defaultProps , {
727+ childrenPropNames : [ 'nope' , 'children' ] ,
728+ initialModel : generateNodes ( [ 'sf' , [ 's' , 's' ] ] , defaultProps . radioGroupValues ) [ 0 ]
729+ } ) ) ;
730+ } ) ;
731+
732+ it ( 'has a childrenPropName matching the first-avilable valid-children model property' , ( ) => {
733+ expect ( wrapper . vm . childrenPropName ) . to . equal ( 'children' ) ;
734+ } ) ;
729735
730- it ( 'has a childrenPropName matching the first-avilable valid-children model property' , ( ) => {
731- expect ( wrapper . vm . childrenPropName ) . to . equal ( 'children' ) ;
736+ it ( 'has a children list of the first-avilable model[childrenPropName] property' , ( ) => {
737+ expect ( wrapper . vm . model . children . length ) . to . equal ( 2 ) ;
738+ } ) ;
732739 } ) ;
733740
734- it ( 'has a children list of the first-avilable model[childrenPropName] property' , ( ) => {
735- expect ( wrapper . vm . model . children . length ) . to . equal ( 2 ) ;
741+ describe ( 'and a valid-children model property is not specified' , ( ) => {
742+
743+ beforeEach ( ( ) => {
744+ let defaultProps = getDefaultPropsData ( ) ;
745+ wrapper = createWrapper ( Object . assign ( defaultProps , {
746+ childrenPropNames : [ 'nope' , 'steve' ] ,
747+ initialModel : generateNodes ( [ 'sf' , [ 's' , 's' ] ] , defaultProps . radioGroupValues ) [ 0 ]
748+ } ) ) ;
749+ } ) ;
750+
751+ it ( 'has a childrenPropName of "children"' , ( ) => {
752+ expect ( wrapper . vm . childrenPropName ) . to . equal ( 'children' ) ;
753+ } ) ;
736754 } ) ;
737755 } ) ;
738756} ) ;
0 commit comments