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

model-dynamic.spec.ts — vue Source File

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

File typescript CompilerSFC StyleProcessor 1 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  0732c067_73c0_62e7_b4d8_730b6a80095b["model-dynamic.spec.ts"]
  c5601857_7faf_30c6_efca_20de90db006c["vue"]
  0732c067_73c0_62e7_b4d8_730b6a80095b --> c5601857_7faf_30c6_efca_20de90db006c
  style 0732c067_73c0_62e7_b4d8_730b6a80095b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import Vue from 'vue'

describe('Directive v-model dynamic input type', () => {
  it('should work', done => {
    const vm = new Vue({
      data: {
        inputType: null,
        test: 'b'
      },
      template: `<input :type="inputType" v-model="test">`
    }).$mount()
    document.body.appendChild(vm.$el)

    // test text
    assertInputWorks(vm, 'inputType').then(done)
  })

  it('with v-if', done => {
    const vm = new Vue({
      data: {
        ok: true,
        type: null,
        test: 'b'
      },
      template: `<input v-if="ok" :type="type" v-model="test"><div v-else>haha</div>`
    }).$mount()
    document.body.appendChild(vm.$el)

    const chain = assertInputWorks(vm)
      .then(() => {
        vm.ok = false
      })
      .then(() => {
        expect(vm.$el.textContent).toBe('haha')
      })
      .then(() => {
        // reset
        vm.ok = true
        vm.type = null
        vm.test = 'b'
      })

    assertInputWorks(vm, chain).then(done)
  })

  it('with v-else', done => {
    const data = {
      ok: true,
      type: null,
      test: 'b'
    }
    const vm = new Vue({
      data,
      template: `<div v-if="ok">haha</div><input v-else :type="type" v-model="test">`
    }).$mount()
    document.body.appendChild(vm.$el)
    expect(vm.$el.textContent).toBe('haha')

    vm.ok = false
    assertInputWorks(vm).then(done)
// ... (175 more lines)

Domain

Subdomains

Functions

Dependencies

  • vue

Frequently Asked Questions

What does model-dynamic.spec.ts do?
model-dynamic.spec.ts is a source file in the vue codebase, written in typescript. It belongs to the CompilerSFC domain, StyleProcessor subdomain.
What functions are defined in model-dynamic.spec.ts?
model-dynamic.spec.ts defines 1 function(s): assertInputWorks.
What does model-dynamic.spec.ts depend on?
model-dynamic.spec.ts imports 1 module(s): vue.
Where is model-dynamic.spec.ts in the architecture?
model-dynamic.spec.ts is located at test/unit/features/directives/model-dynamic.spec.ts (domain: CompilerSFC, subdomain: StyleProcessor, 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