Skip to content

Commit

Permalink
test: v-link null
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Oct 13, 2015
1 parent d01eaf3 commit 136962b
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions test/unit/specs/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,10 @@ describe('Core', function () {
},
// test v-link with relative path + append
'/c': {
component: { template: '<a id="link-c" v-link="{ path: \'d\', append: true }">Link C</a><router-view></router-view>' },
component: { template:
'<a id="link-c" v-link="{ path: \'d\', append: true }">Link C</a><router-view></router-view>' +
'<a id="link-null" v-link="{ path: null }"></a>'
},
subRoutes: {
'/d': {
component: { template: '+D' }
Expand Down Expand Up @@ -231,11 +234,16 @@ describe('Core', function () {
router.go('/c')
nextTick(function () {
expect(el.textContent).toBe('Link C')
var link = el.querySelector('#link-c')
click(link)
var nullLink = el.querySelector('#link-null')
click(nullLink)
nextTick(function () {
expect(el.textContent).toBe('Link C+D')
done()
expect(el.textContent).toBe('Link C')
var link = el.querySelector('#link-c')
click(link)
nextTick(function () {
expect(el.textContent).toBe('Link C+D')
done()
})
})
})
})
Expand Down

0 comments on commit 136962b

Please sign in to comment.