How to use avoriaz - 10 common examples

To help you get started, we’ve selected a few avoriaz 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 youzan / vant / test / specs / number-keyboard.spec.js View on Github external
it('blur keyboard', (done) => {
    wrapper = mount(NumberKeyboard, {
      attachToDocument: true
    });

    const blur = sinon.spy();
    wrapper.vm.$on('blur', blur);

    triggerTouch(document.body, 'touchstart');
    wrapper.vm.$nextTick(() => {
      expect(blur.calledOnce).to.be.true;
      done();
    });
  });
github youzan / vant / test / specs / datetime-picker.spec.js View on Github external
it('create a time picker', () => {
    wrapper = mount(DatetimePicker, {
      attachToDocument: true,
      propsData: {
        type: 'time',
        value: testTime
      }
    });
    expect(wrapper.vm.innerValue).to.equal(testTime);
  });
github youzan / vant / test / specs / loading.spec.js View on Github external
it('loading size', () => {
    wrapper = mount(Loading, {
      propsData: {
        size: '100px'
      }
    });
    expect(wrapper.vm.$el.style.width).to.equal('100px');
    expect(wrapper.vm.$el.style.height).to.equal('100px');
  });
});
github youzan / vant / test / specs / coupon.spec.js View on Github external
it('displayedCouponIndex out of range', (done) => {
    wrapper = mount(CouponList, {
      propsData: {
        displayedCouponIndex: -100,
        coupons: [coupon, discountCoupon, emptyCoupon]
      }
    });

    wrapper.vm.$nextTick(() => {
      expect(wrapper.vm.chosenCoupon).to.equal(-1);
      done();
    });
  });
});
github youzan / vant / test / specs / area.spec.js View on Github external
it('create an area with invalid areaList', () => {
    wrapper = mount(Area, {
      propsData: {
        areaList: null
      }
    });

    expect(wrapper.vm.columns.length).to.equal(0);
  });
github youzan / vant / test / specs / stepper.spec.js View on Github external
it('only disable stepper input', () => {
    wrapper = mount(Stepper, {
      propsData: {
        disableInput: true
      }
    });

    const input = wrapper.find('.van-stepper__input')[0];
    expect(input.hasAttribute('disabled', 'disabled')).to.be.true;
  });
github youzan / vant / test / specs / badge.spec.js View on Github external
it('emit a click event when click badge', () => {
    wrapper = mount(BadgeTestComponent);

    const badge = wrapper.find('.van-badge')[0];
    const eventStub = sinon.stub(badge.vNode.child, '$emit');
    badge.trigger('click');

    expect(eventStub.calledWith('click')).to.be.true;
  });
});
github youzan / vant / test / specs / address-list.spec.js View on Github external
it('create a AddressList with three items', () => {
    wrapper = mount(AddressList, {
      propsData: {
        value: '1',
        list
      }
    });
    expect(wrapper.find('.van-address-list__group .van-cell').length).to.equal(3);
    expect(wrapper.find('.van-icon-checked').length).to.equal(1);
  });
github youzan / vant / test / unit / specs / order-goods.spec.js View on Github external
it('shopLink prop', () => {
    wrapper = mount(OrderGoods, {
      attachToDocument: true,
      propsData: {
        itemList: [item1],
        shopLink: 'http://www.youzan.com'
      }
    });

    expect(wrapper.find('.van-order-goods-header a')[0].element.getAttribute('href')).to.equal('http://www.youzan.com');
  });
github youzan / vant / test / specs / tabs.spec.js View on Github external
it('create a tabs with four tab', (done) => {
    wrapper = mount(TabsTestComponent);

    expect(wrapper.hasClass('van-tabs')).to.be.true;
    expect(wrapper.hasClass('van-tabs--line')).to.be.true;

    const tabsContainer = wrapper.find('.van-tabs')[0];
    expect(tabsContainer.vNode.child.curActive).to.equal(0);

    wrapper.vm.active = 1;
    wrapper.update();
    wrapper.vm.$nextTick(() => {
      expect(tabsContainer.vNode.child.curActive).to.equal(1);
      done();
    });
  });

avoriaz

a Vue.js testing utility library

MIT
Latest version published 6 years ago

Package Health Score

51 / 100
Full package analysis

Popular avoriaz functions