Sha256: 8477216ee96ea3797344b07f78eae450c7a2c692c9b6d3a1a01f38245e55e6ce

Contents?: true

Size: 709 Bytes

Versions: 2

Compression:

Stored size: 709 Bytes

Contents

// Generated by vuejs gem ~> github.com/ytbryan/vuejs 
// To generate another component with test, please run `rails g vue something --test`

import { shallowMount } from '@vue/test-utils'
import List from '../parts/<%= name %>/<%= name %>.vue'

describe('<%= name %>.vue', () => {
  it('renders li for each item in props.items', () => {
    const items = ['1', '2']
    const wrapper = shallowMount(List, {
      propsData: { items }
    })
    expect(wrapper.findAll('li')).toHaveLength(items.length)
  })

  it('matches snapshot', () => {
    const items = ['item 1', 'item 2']
    const wrapper = shallowMount(List, {
      propsData: { items }
    })
    expect(wrapper.html()).toMatchSnapshot()
  })
})

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vuejs-1.1.0.beta3 lib/generators/generator_templates/tests/unit.test.js.erb
vuejs-1.1.0.beta2 lib/generators/generator_templates/tests/unit.test.js.erb