[英]Typescript Jasmine testing case keeps failing
我不知道为什么会出现以下测试失败,这表明我正在使用find()
。 我正在寻找一个按钮购买testID
,触发点击,并使用find()
来检查我要检查的其他 2 个元素。:
**
[chunk-2] Expected $.length = 0 to equal 2.
[chunk-2] Expected $[0] = undefined to equal 'oldClock'.
[chunk-2] Expected $[1] = undefined to equal true.
**
describe('@emitTime', function () {
it('emits a time event when clock is clicked', function (this: TestContext) {
this.wrapper = this.mountComponent(TimeClockComponent, {
notids: [
{
enabled: false,
name: 'newClock',
},
],
});
this.wrapper.find(testID('TimeClockComponent')).trigger('click');
this.wrapper.find(testID('item-oldClock');
this.wrapper.find(testID('item-newClock');
expect(this.wrapper.emitted()!.emitTime![1]).toEqual(['oldClock', true]);
expect(this.wrapper.emitted()!.emitTime![2]).toEqual(['newClock', true]);
});
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.