File tree Expand file tree Collapse file tree 3 files changed +17
-12
lines changed
src/components/MdList/MdListItem Expand file tree Collapse file tree 3 files changed +17
-12
lines changed Original file line number Diff line number Diff line change 1
1
import mountTemplate from 'test/utils/mountTemplate'
2
- import MdList from './MdList .vue'
2
+ import MdListItem from './MdListItem .vue'
3
3
4
- test ( 'should render the list' , async ( ) => {
5
- const template = '<md-list>Lorem ipsum</md-list>'
6
- const wrapper = await mountTemplate ( MdList , template )
4
+ test ( 'should render the list item ' , async ( ) => {
5
+ const template = '<md-list-item >Lorem ipsum</md-list-item >'
6
+ const wrapper = await mountTemplate ( MdListItem , template )
7
7
8
- expect ( wrapper . hasClass ( 'md-list' ) ) . toBe ( true )
9
- expect ( wrapper . text ( ) ) . toBe ( 'Lorem ipsum' )
8
+ expect ( wrapper . hasClass ( 'md-list-item ' ) ) . toBe ( true )
9
+ expect ( wrapper . text ( ) . trim ( ) ) . toBe ( 'Lorem ipsum' )
10
10
} )
11
11
12
12
test ( 'should render the theme class' , async ( ) => {
13
- const template = '<md-list md-theme="alt">Lorem ipsum</md-list>'
14
- const wrapper = await mountTemplate ( MdList , template )
13
+ const template = '<md-list-item md-theme="alt">Lorem ipsum</md-list-item >'
14
+ const wrapper = await mountTemplate ( MdListItem , template )
15
15
16
16
expect ( wrapper . hasClass ( 'md-theme-alt' ) ) . toBe ( true )
17
17
} )
Original file line number Diff line number Diff line change 1
1
<script >
2
+ import MdRouterLinkProps from ' core/MdRouterLinkProps'
2
3
import MdListItemButton from ' ./MdListItemButton'
3
4
import MdListItemLink from ' ./MdListItemLink'
4
5
import MdListItemRouter from ' ./MdListItemRouter'
15
16
16
17
if (parent && parent .$router && props .to ) {
17
18
listComponent = MdListItemRouter
18
- listComponent .props = {
19
- target: String ,
20
- ... parent .$options .components [' router-link' ].options .props
21
- }
19
+ listComponent .props = MdRouterLinkProps (parent, {
20
+ target: String
21
+ })
22
22
delete listComponent .props .href
23
23
} else if (props .href ) {
24
24
listComponent = MdListItemLink
Original file line number Diff line number Diff line change 5
5
</template >
6
6
7
7
<script >
8
+ import MdRipple from ' components/MdRipple/MdRipple.vue'
9
+
8
10
export default {
9
11
name: ' MdListItemContent' ,
12
+ components: {
13
+ MdRipple
14
+ },
10
15
props: {
11
16
mdDisabled: Boolean
12
17
}
You can’t perform that action at this time.
0 commit comments