Skip to content

Commit 136962b

Browse files
committed
test: v-link null
1 parent d01eaf3 commit 136962b

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

test/unit/specs/core.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,10 @@ describe('Core', function () {
199199
},
200200
// test v-link with relative path + append
201201
'/c': {
202-
component: { template: '<a id="link-c" v-link="{ path: \'d\', append: true }">Link C</a><router-view></router-view>' },
202+
component: { template:
203+
'<a id="link-c" v-link="{ path: \'d\', append: true }">Link C</a><router-view></router-view>' +
204+
'<a id="link-null" v-link="{ path: null }"></a>'
205+
},
203206
subRoutes: {
204207
'/d': {
205208
component: { template: '+D' }
@@ -231,11 +234,16 @@ describe('Core', function () {
231234
router.go('/c')
232235
nextTick(function () {
233236
expect(el.textContent).toBe('Link C')
234-
var link = el.querySelector('#link-c')
235-
click(link)
237+
var nullLink = el.querySelector('#link-null')
238+
click(nullLink)
236239
nextTick(function () {
237-
expect(el.textContent).toBe('Link C+D')
238-
done()
240+
expect(el.textContent).toBe('Link C')
241+
var link = el.querySelector('#link-c')
242+
click(link)
243+
nextTick(function () {
244+
expect(el.textContent).toBe('Link C+D')
245+
done()
246+
})
239247
})
240248
})
241249
})

0 commit comments

Comments
 (0)