Home / File/ bind.spec.ts — vue Source File

bind.spec.ts — vue Source File

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

File typescript 1 imports

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

import Vue from 'vue'

describe('Directive v-bind', () => {
  it('normal attr', done => {
    const vm = new Vue({
      template: '<div><span :test="foo">hello</span></div>',
      data: { foo: 'ok' }
    }).$mount()
    expect(vm.$el.firstChild.getAttribute('test')).toBe('ok')
    vm.foo = 'again'
    waitForUpdate(() => {
      expect(vm.$el.firstChild.getAttribute('test')).toBe('again')
      vm.foo = null
    })
      .then(() => {
        expect(vm.$el.firstChild.hasAttribute('test')).toBe(false)
        vm.foo = false
      })
      .then(() => {
        expect(vm.$el.firstChild.hasAttribute('test')).toBe(false)
        vm.foo = true
      })
      .then(() => {
        expect(vm.$el.firstChild.getAttribute('test')).toBe('true')
        vm.foo = 0
      })
      .then(() => {
        expect(vm.$el.firstChild.getAttribute('test')).toBe('0')
      })
      .then(done)
  })

  it('should set property for input value', done => {
    const vm = new Vue({
      template: `
        <div>
          <input type="text" :value="foo">
          <input type="checkbox" :checked="bar">
        </div>
      `,
      data: {
        foo: 'ok',
        bar: false
      }
    }).$mount()
    expect(vm.$el.firstChild.value).toBe('ok')
    expect(vm.$el.lastChild.checked).toBe(false)
    vm.bar = true
    waitForUpdate(() => {
      expect(vm.$el.lastChild.checked).toBe(true)
    }).then(done)
  })

  it('xlink', done => {
    const vm = new Vue({
      template: '<svg><a :xlink:special="foo"></a></svg>',
      data: {
        foo: 'ok'
      }
    }).$mount()
// ... (572 more lines)

Dependencies

  • vue

Frequently Asked Questions

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