model-radio.spec.ts — vue Source File
Architecture documentation for model-radio.spec.ts, a typescript file in the vue codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR c6715547_2155_7089_04ff_fbc59bc9181e["model-radio.spec.ts"] db9e7bef_009d_3918_6e7d_543a36a38d75["vue"] c6715547_2155_7089_04ff_fbc59bc9181e --> db9e7bef_009d_3918_6e7d_543a36a38d75 style c6715547_2155_7089_04ff_fbc59bc9181e fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import Vue from 'vue'
describe('Directive v-model radio', () => {
it('should work', done => {
const vm = new Vue({
data: {
test: '1'
},
template: `
<div>
<input type="radio" value="1" v-model="test" name="test">
<input type="radio" value="2" v-model="test" name="test">
</div>
`
}).$mount()
document.body.appendChild(vm.$el)
expect(vm.$el.children[0].checked).toBe(true)
expect(vm.$el.children[1].checked).toBe(false)
vm.test = '2'
waitForUpdate(() => {
expect(vm.$el.children[0].checked).toBe(false)
expect(vm.$el.children[1].checked).toBe(true)
vm.$el.children[0].click()
expect(vm.$el.children[0].checked).toBe(true)
expect(vm.$el.children[1].checked).toBe(false)
expect(vm.test).toBe('1')
})
.then(() => {
document.body.removeChild(vm.$el)
})
.then(done)
})
it('should respect value bindings', done => {
const vm = new Vue({
data: {
test: 1
},
template: `
<div>
<input type="radio" :value="1" v-model="test" name="test">
<input type="radio" :value="2" v-model="test" name="test">
</div>
`
}).$mount()
document.body.appendChild(vm.$el)
expect(vm.$el.children[0].checked).toBe(true)
expect(vm.$el.children[1].checked).toBe(false)
vm.test = 2
waitForUpdate(() => {
expect(vm.$el.children[0].checked).toBe(false)
expect(vm.$el.children[1].checked).toBe(true)
vm.$el.children[0].click()
expect(vm.$el.children[0].checked).toBe(true)
expect(vm.$el.children[1].checked).toBe(false)
expect(vm.test).toBe(1)
})
.then(() => {
document.body.removeChild(vm.$el)
})
// ... (210 more lines)
Dependencies
- vue
Source
Frequently Asked Questions
What does model-radio.spec.ts do?
model-radio.spec.ts is a source file in the vue codebase, written in typescript.
What does model-radio.spec.ts depend on?
model-radio.spec.ts imports 1 module(s): vue.
Where is model-radio.spec.ts in the architecture?
model-radio.spec.ts is located at test/unit/features/directives/model-radio.spec.ts (directory: test/unit/features/directives).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free