@@ -216,15 +216,17 @@ describe('Core', function () {
216216 it ( 'v-link active classes' , function ( done ) {
217217 router = new Router ( {
218218 abstract : true ,
219- linkActiveClass : 'active' ,
220- linkActiveExactClass : 'active-exact'
219+ linkActiveClass : 'active'
221220 } )
222221 var App = Vue . extend ( {
223222 replace : false ,
223+ data : function ( ) {
224+ return { className : 'custom' }
225+ } ,
224226 template :
225227 '<a id="link-a" v-link="{ path: \'/a\' }">Link A</a>' +
226- '<a id="link-b" v-link="{ path: \'/b\' }">Link B</a>' +
227- '<a id="link-c" v-link="{ path: \'/\' }">Link C</a>' +
228+ '<a id="link-b" v-link="{ path: \'/b\', activeClass: className }">Link B</a>' +
229+ '<a id="link-c" v-link="{ path: \'/\', exactMatch: true }">Link C</a>' +
228230 '<router-view></router-view>'
229231 } )
230232 router . start ( App , el )
@@ -234,26 +236,27 @@ describe('Core', function () {
234236 var linkC = el . querySelector ( '#link-c' )
235237 expect ( linkA . className ) . toBe ( '' )
236238 expect ( linkB . className ) . toBe ( '' )
237- expect ( linkC . className ) . toBe ( 'active active-exact ' )
239+ expect ( linkC . className ) . toBe ( 'active' )
238240 router . go ( '/a' )
239241 nextTick ( function ( ) {
240- expect ( linkA . className ) . toBe ( 'active active-exact ' )
242+ expect ( linkA . className ) . toBe ( 'active' )
241243 expect ( linkB . className ) . toBe ( '' )
242244 expect ( linkC . className ) . toBe ( '' )
243245 router . go ( '/a/b/c' )
244246 nextTick ( function ( ) {
245247 expect ( linkA . className ) . toBe ( 'active' )
246248 expect ( linkB . className ) . toBe ( '' )
247- // expect(linkC.className).toBe('')
249+ expect ( linkC . className ) . toBe ( '' )
248250 router . go ( '/b' )
249251 nextTick ( function ( ) {
250252 expect ( linkA . className ) . toBe ( '' )
251- expect ( linkB . className ) . toBe ( 'active active-exact ' )
253+ expect ( linkB . className ) . toBe ( 'custom ' )
252254 expect ( linkC . className ) . toBe ( '' )
255+ router . app . className = 'changed'
253256 router . go ( '/b/c/d' )
254257 nextTick ( function ( ) {
255258 expect ( linkA . className ) . toBe ( '' )
256- expect ( linkB . className ) . toBe ( 'active ' )
259+ expect ( linkB . className ) . toBe ( 'changed ' )
257260 expect ( linkC . className ) . toBe ( '' )
258261 router . go ( '/bcd' )
259262 nextTick ( function ( ) {
0 commit comments