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

model-text.spec.ts — vue Source File

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

File typescript 2 imports

Entity Profile

Dependency Diagram

graph LR
  24076981_bb7c_d6c8_b1d3_7e2761354370["model-text.spec.ts"]
  db9e7bef_009d_3918_6e7d_543a36a38d75["vue"]
  24076981_bb7c_d6c8_b1d3_7e2761354370 --> db9e7bef_009d_3918_6e7d_543a36a38d75
  1ec7e50f_8f20_0656_28f0_45cecc26cf74["env"]
  24076981_bb7c_d6c8_b1d3_7e2761354370 --> 1ec7e50f_8f20_0656_28f0_45cecc26cf74
  style 24076981_bb7c_d6c8_b1d3_7e2761354370 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import Vue from 'vue'
import { isIE9, isIE, isAndroid } from 'core/util/env'

describe('Directive v-model text', () => {
  it('should update value both ways', done => {
    const vm = new Vue({
      data: {
        test: 'b'
      },
      template: '<input v-model="test">'
    }).$mount()
    expect(vm.$el.value).toBe('b')
    vm.test = 'a'
    waitForUpdate(() => {
      expect(vm.$el.value).toBe('a')
      vm.$el.value = 'c'
      triggerEvent(vm.$el, 'input')
      expect(vm.test).toBe('c')
    }).then(done)
  })

  it('should work with space ended expression in v-model', () => {
    const vm = new Vue({
      data: {
        obj: {
          test: 'b'
        }
      },
      template: '<input v-model="obj.test ">'
    }).$mount()

    triggerEvent(vm.$el, 'input')
    expect(vm.obj['test ']).toBe(undefined)
    expect(vm.obj.test).toBe('b')
  })

  it('.lazy modifier', () => {
    const vm = new Vue({
      data: {
        test: 'b'
      },
      template: '<input v-model.lazy="test">'
    }).$mount()
    expect(vm.$el.value).toBe('b')
    expect(vm.test).toBe('b')
    vm.$el.value = 'c'
    triggerEvent(vm.$el, 'input')
    expect(vm.test).toBe('b')
    triggerEvent(vm.$el, 'change')
    expect(vm.test).toBe('c')
  })

  it('.number modifier', () => {
    const vm = new Vue({
      data: {
        test: 1
      },
      template: '<input v-model.number="test">'
    }).$mount()
    expect(vm.test).toBe(1)
// ... (429 more lines)

Dependencies

  • env
  • vue

Frequently Asked Questions

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