@@ -276,7 +276,8 @@ describe('Compile', function () {
276
276
twoWayWarn : null ,
277
277
testOneTime : null ,
278
278
optimizeLiteral : null ,
279
- optimizeLiteralStr : null
279
+ optimizeLiteralStr : null ,
280
+ literalWithFilter : null
280
281
}
281
282
el . innerHTML = '<div ' +
282
283
'v-bind:test-normal="a" ' +
@@ -286,9 +287,13 @@ describe('Compile', function () {
286
287
':optimize-literal-str="\'true\'"' +
287
288
':test-two-way.sync="a" ' +
288
289
':two-way-warn.sync="a + 1" ' +
289
- ':test-one-time.once="a"></div>'
290
+ ':test-one-time.once="a" ' +
291
+ ':literal-with-filter="\'HI\' | lowercase"' +
292
+ '></div>'
290
293
compiler . compileAndLinkProps ( vm , el . firstChild , props )
291
- expect ( vm . _bindDir . calls . count ( ) ) . toBe ( 3 ) // skip literal and one time
294
+ // check bindDir calls:
295
+ // skip literal and one time, but not literal with filter
296
+ expect ( vm . _bindDir . calls . count ( ) ) . toBe ( 4 )
292
297
// literal
293
298
expect ( vm . testLiteral ) . toBe ( '1' )
294
299
expect ( vm . _data . testLiteral ) . toBe ( '1' )
@@ -317,6 +322,14 @@ describe('Compile', function () {
317
322
expect ( prop . mode ) . toBe ( bindingModes . TWO_WAY )
318
323
// two way warn
319
324
expect ( hasWarned ( 'non-settable parent path' ) ) . toBe ( true )
325
+ // literal with filter
326
+ args = vm . _bindDir . calls . argsFor ( 3 )
327
+ prop = args [ 0 ] . prop
328
+ expect ( args [ 0 ] . name ) . toBe ( 'prop' )
329
+ expect ( prop . path ) . toBe ( 'literalWithFilter' )
330
+ expect ( prop . parentPath ) . toBe ( "'HI'" )
331
+ expect ( prop . filters . length ) . toBe ( 1 )
332
+ expect ( prop . mode ) . toBe ( bindingModes . ONE_WAY )
320
333
} )
321
334
322
335
it ( 'props on root instance' , function ( ) {
0 commit comments