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 {
4
4
FUNCTIONAL_OPTIONS
5
5
} from 'shared/consts'
6
6
import { isConstructor } from 'shared/validators'
7
+ import { capitalize } from 'shared/util'
7
8
8
9
function vmMatchesName ( vm , name ) {
9
- const lc = ( name = '' ) => name . toLowerCase ( )
10
- const lowerCaseName = lc ( name )
11
10
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
+ )
15
17
)
16
18
}
17
19
Original file line number Diff line number Diff line change @@ -431,14 +431,7 @@ describeWithShallowAndMount('find', mountingMethod => {
431
431
)
432
432
} )
433
433
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 ' , ( ) => {
442
435
const component = {
443
436
name : 'CamelCase' ,
444
437
render : h => h ( 'div' )
You can’t perform that action at this time.
0 commit comments