Home / Function/ assertInputWorks() — vue Function Reference

assertInputWorks() — vue Function Reference

Architecture documentation for the assertInputWorks() function in model-dynamic.spec.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  e5b279ab_7bf3_6e51_d16d_83df58dfa772["assertInputWorks()"]
  0732c067_73c0_62e7_b4d8_730b6a80095b["model-dynamic.spec.ts"]
  e5b279ab_7bf3_6e51_d16d_83df58dfa772 -->|defined in| 0732c067_73c0_62e7_b4d8_730b6a80095b
  style e5b279ab_7bf3_6e51_d16d_83df58dfa772 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

test/unit/features/directives/model-dynamic.spec.ts lines 191–234

function assertInputWorks(vm, type, chain) {
  if (typeof type !== 'string') {
    if (!chain) chain = type
    type = 'type'
  }
  if (!chain) chain = waitForUpdate()
  chain
    .then(() => {
      expect(vm.$el.value).toBe('b')
      vm.test = 'a'
    })
    .then(() => {
      expect(vm.$el.value).toBe('a')
      vm.$el.value = 'c'
      triggerEvent(vm.$el, 'input')
      expect(vm.test).toBe('c')
    })
    .then(() => {
      // change it to password
      vm[type] = 'password'
      vm.test = 'b'
    })
    .then(() => {
      expect(vm.$el.type).toBe('password')
      expect(vm.$el.value).toBe('b')
      vm.$el.value = 'c'
      triggerEvent(vm.$el, 'input')
      expect(vm.test).toBe('c')
    })
    .then(() => {
      // change it to checkbox...
      vm[type] = 'checkbox'
    })
    .then(() => {
      expect(vm.$el.type).toBe('checkbox')
      expect(vm.$el.checked).toBe(true)
    })
    .then(() => {
      vm.$el.click()
      expect(vm.$el.checked).toBe(false)
      expect(vm.test).toBe(false)
    })
  return chain
}

Domain

Subdomains

Frequently Asked Questions

What does assertInputWorks() do?
assertInputWorks() is a function in the vue codebase, defined in test/unit/features/directives/model-dynamic.spec.ts.
Where is assertInputWorks() defined?
assertInputWorks() is defined in test/unit/features/directives/model-dynamic.spec.ts at line 191.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free