File tree Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -4,14 +4,16 @@ import {
44 FUNCTIONAL_OPTIONS
55} from 'shared/consts'
66import { isConstructor } from 'shared/validators'
7+ import { capitalize } from 'shared/util'
78
89function vmMatchesName ( vm , name ) {
9- const lc = ( name = '' ) => name . toLowerCase ( )
10- const lowerCaseName = lc ( name )
1110 return (
12- ! ! name &&
13- ( lc ( vm . name ) === lowerCaseName ||
14- ( vm . $options && lc ( vm . $options . name ) === lowerCaseName ) )
11+ ! ! name && (
12+ vm . name === name ||
13+ ( vm . $options && vm . $options . name === name ) ||
14+ vm . name === capitalize ( name ) ||
15+ vm . $options && vm . $options . name === capitalize ( name )
16+ )
1517 )
1618}
1719
Original file line number Diff line number Diff line change @@ -431,14 +431,7 @@ describeWithShallowAndMount('find', mountingMethod => {
431431 )
432432 } )
433433
434- it ( 'returns a Wrapper matching a component camel case name in options object' , ( ) => {
435- const wrapper = mountingMethod ( ComponentWithChild )
436- expect ( wrapper . find ( { name : 'test-Component' } ) . name ( ) ) . to . equal (
437- 'test-component'
438- )
439- } )
440-
441- it ( 'returns a Wrapper matching a name disregarding case in options object' , ( ) => {
434+ it ( 'returns a Wrapper matching a camelCase name option and a Pascal Case component name ' , ( ) => {
442435 const component = {
443436 name : 'CamelCase' ,
444437 render : h => h ( 'div' )
You can’t perform that action at this time.
0 commit comments