Skip to content

Commit

Permalink
fix(v-model): add failing test for vuejs#9330.
Browse files Browse the repository at this point in the history
  • Loading branch information
lbogdan committed Jan 17, 2019
1 parent 730a10f commit 7d5e34c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/unit/features/directives/model-component.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,30 @@ describe('Directive v-model component', () => {
expect(triggerCount).toBe(1)
document.body.removeChild(vm.$el)
})

// #9330
it('should add value to $attrs if not defined in props', () => {
const TestComponent = {
inheritAttrs: false,
render (h) {
return h('div', this.$attrs.value)
}
}

const vm = new Vue({
components: {
TestComponent
},
template: `
<div>
<test-component v-model="val"/>
</div>
`,
data: {
val: 'foo'
}
}).$mount()

expect(vm.$el.innerHTML).toBe('<div>foo</div>');
})
})

0 comments on commit 7d5e34c

Please sign in to comment.