Home / File/ model-component.spec.ts — vue Source File

model-component.spec.ts — vue Source File

Architecture documentation for model-component.spec.ts, a typescript file in the vue codebase. 1 imports, 0 dependents.

File typescript 1 imports

Entity Profile

Dependency Diagram

graph LR
  f61ce1f7_3c2d_b546_90f6_666c74f57186["model-component.spec.ts"]
  db9e7bef_009d_3918_6e7d_543a36a38d75["vue"]
  f61ce1f7_3c2d_b546_90f6_666c74f57186 --> db9e7bef_009d_3918_6e7d_543a36a38d75
  style f61ce1f7_3c2d_b546_90f6_666c74f57186 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import Vue from 'vue'

describe('Directive v-model component', () => {
  it('should work', done => {
    const vm = new Vue({
      data: {
        msg: 'hello'
      },
      template: `
        <div>
          <p>{{ msg }}</p>
          <test v-model="msg"></test>
        </div>
      `,
      components: {
        test: {
          props: ['value'],
          template: `<input :value="value" @input="$emit('input', $event.target.value)">`
        }
      }
    }).$mount()
    document.body.appendChild(vm.$el)
    waitForUpdate(() => {
      const input = vm.$el.querySelector('input')
      input.value = 'world'
      triggerEvent(input, 'input')
    })
      .then(() => {
        expect(vm.msg).toEqual('world')
        expect(vm.$el.querySelector('p').textContent).toEqual('world')
        vm.msg = 'changed'
      })
      .then(() => {
        expect(vm.$el.querySelector('p').textContent).toEqual('changed')
        expect(vm.$el.querySelector('input').value).toEqual('changed')
      })
      .then(() => {
        document.body.removeChild(vm.$el)
      })
      .then(done)
  })

  it('should work with native tags with "is"', done => {
    const vm = new Vue({
      data: {
        msg: 'hello'
      },
      template: `
        <div>
          <p>{{ msg }}</p>
          <input is="test" v-model="msg">
        </div>
      `,
      components: {
        test: {
          props: ['value'],
          template: `<input :value="value" @input="$emit('input', $event.target.value)">`
        }
      }
    }).$mount()
// ... (186 more lines)

Dependencies

  • vue

Frequently Asked Questions

What does model-component.spec.ts do?
model-component.spec.ts is a source file in the vue codebase, written in typescript.
What does model-component.spec.ts depend on?
model-component.spec.ts imports 1 module(s): vue.
Where is model-component.spec.ts in the architecture?
model-component.spec.ts is located at test/unit/features/directives/model-component.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