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

for.spec.ts — vue Source File

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

File typescript 2 imports

Entity Profile

Dependency Diagram

graph LR
  2748802d_a529_606f_86fb_8f818dff3304["for.spec.ts"]
  db9e7bef_009d_3918_6e7d_543a36a38d75["vue"]
  2748802d_a529_606f_86fb_8f818dff3304 --> db9e7bef_009d_3918_6e7d_543a36a38d75
  1ec7e50f_8f20_0656_28f0_45cecc26cf74["env"]
  2748802d_a529_606f_86fb_8f818dff3304 --> 1ec7e50f_8f20_0656_28f0_45cecc26cf74
  style 2748802d_a529_606f_86fb_8f818dff3304 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import Vue from 'vue'
import { hasSymbol } from 'core/util/env'

describe('Directive v-for', () => {
  it('should render array of primitive values', done => {
    const vm = new Vue({
      template: `
        <div>
          <span v-for="item in list">{{item}}</span>
        </div>
      `,
      data: {
        list: ['a', 'b', 'c']
      }
    }).$mount()
    expect(vm.$el.innerHTML).toBe('<span>a</span><span>b</span><span>c</span>')
    Vue.set(vm.list, 0, 'd')
    waitForUpdate(() => {
      expect(vm.$el.innerHTML).toBe(
        '<span>d</span><span>b</span><span>c</span>'
      )
      vm.list.push('d')
    })
      .then(() => {
        expect(vm.$el.innerHTML).toBe(
          '<span>d</span><span>b</span><span>c</span><span>d</span>'
        )
        vm.list.splice(1, 2)
      })
      .then(() => {
        expect(vm.$el.innerHTML).toBe('<span>d</span><span>d</span>')
        vm.list = ['x', 'y']
      })
      .then(() => {
        expect(vm.$el.innerHTML).toBe('<span>x</span><span>y</span>')
      })
      .then(done)
  })

  it('should render array of primitive values with index', done => {
    const vm = new Vue({
      template: `
        <div>
          <span v-for="(item, i) in list">{{i}}-{{item}}</span>
        </div>
      `,
      data: {
        list: ['a', 'b', 'c']
      }
    }).$mount()
    expect(vm.$el.innerHTML).toBe(
      '<span>0-a</span><span>1-b</span><span>2-c</span>'
    )
    Vue.set(vm.list, 0, 'd')
    waitForUpdate(() => {
      expect(vm.$el.innerHTML).toBe(
        '<span>0-d</span><span>1-b</span><span>2-c</span>'
      )
      vm.list.push('d')
    })
// ... (826 more lines)

Dependencies

  • env
  • vue

Frequently Asked Questions

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