@@ -719,20 +719,38 @@ describe('TreeViewNode.vue', () => {
719
719
720
720
describe ( 'when childrenPropNames is specified' , ( ) => {
721
721
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
+ } ) ;
729
735
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
+ } ) ;
732
739
} ) ;
733
740
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
+ } ) ;
736
754
} ) ;
737
755
} ) ;
738
756
} ) ;
0 commit comments