How to use the vue-test-utils.mount function in vue-test-utils

To help you get started, we’ve selected a few vue-test-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ktsn / vue-form-builder / test / unit / Helpers.spec.ts View on Github external
it('should update its value with changing model', () => {
      const wrapper = mount(create(``))

      const checkbox = q(wrapper, 'input')
      assert(checkbox.checked === true)
      wrapper.vm.user.hasPhone = false
      return Vue.nextTick().then(() => {
        assert(checkbox.checked === false)
      })
    })
github staskobzar / amiws_queue / test / unit / specs / AmiServers.spec.js View on Github external
it('can not disable single AMI server in list', () => {
    Fixtures.oneServer.forEach(msg => store.dispatch('newMessage', msg))
    const comp = mount(AmiServers, {store, localVue})
    expect(store.state.selectedServers.length).to.equal(1)
    comp.find('.disable-server .input-group--selection-controls__ripple--active').trigger('click')
    expect(store.state.selectedServers.length).to.equal(1)
    expect(comp.vm.notify).to.equal(true)
  })
})
github ktsn / vue-form-builder / test / unit / Helpers.spec.ts View on Github external
it('should be converted to textarea element', () => {
      const wrapper = mount(create(``))

      assertAttrs(wrapper, 'textarea', null, 'name')
      assertValue(wrapper, 'textarea', 'foo')

      const el = q(wrapper, 'textarea')
      assert(el.textContent === 'foo')
    })
github creativetimofficial / vue-light-bootstrap-dashboard / test / unit / specs / FormGroupInput.spec.js View on Github external
it('should have a label', () => {
    const wrapper = mount(FormGroupInput, {
      propsData: {
        label: 'my label'
      }
    })

    const label = wrapper.find('label')
    expect(label.text().trim()).to.equal('my label')
  })
})
github wemake-services / wemake-vue-template / tests / unit / components / counter.spec.js View on Github external
it('should increment counter', () => {
    const wrapper = mount(Counter, { store, localVue })

    wrapper.vm.$store.commit(types.INCREMENT)
    expect(wrapper.vm.count).toBe(1)
  })
github tianyong90 / we-vue / test / unit / specs / picker-slot.spec.js View on Github external
it('click slot to change the current-value', (done) => {
    wrapper = mount(Picker, {
      attachToDocument: true,
      propsData: {
        slots: [
          {
            values: [1, 2, 3],
            defaultIndex: 0
          }
        ]
      }
    })

    setTimeout(() => {
      const indicator = wrapper.find('.weui-picker__indicator').element

      const indicatorRect = indicator.getBoundingClientRect()
github creativetimofficial / vue-light-bootstrap-dashboard / test / unit / unit / specs / Overview.spec.js View on Github external
it('should contain 4 stats cards 3 chart cards and 4 circle charts', () => {
    const wrapper = mount(Overview)
    const children = wrapper.vm.$children
    const statsCards = filterChildren(children, 'stats-card').length
    const chartCards = filterChildren(children, 'chart-card').length
    const circleChartCards = filterChildren(children, 'circle-chart-card').length
    expect(statsCards).to.equal(4)
    expect(chartCards).to.equal(1)
    expect(circleChartCards).to.equal(4)

  })
})
github Kitware / CDash / tests / Spec / page-header / header-top.spec.js View on Github external
beforeEach(() => {
    component = mount(HeaderTop, {
      propsData: {
        user: {},
        pathname: '/api/v1/build/1234',
        menu: {
          home: 'viewProjects.php'
        }
      }
    });
  });

vue-test-utils

Utilities for testing Vue components.

MIT
Latest version published 6 years ago

Package Health Score

59 / 100
Full package analysis