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
  58ac7ecd_910f_ac9f_f29f_03ab7f77e38e["bind.spec.ts"]
  db9e7bef_009d_3918_6e7d_543a36a38d75["vue"]
  58ac7ecd_910f_ac9f_f29f_03ab7f77e38e --> db9e7bef_009d_3918_6e7d_543a36a38d75
  style 58ac7ecd_910f_ac9f_f29f_03ab7f77e38e 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