Skip to content

Commit

Permalink
fix: update
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu committed Aug 17, 2023
1 parent 0558c7f commit 376a995
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/packages/__VUE/countdown/__tests__/countdown.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ test('endTime props', async () => {
endTime: Date.now() + 1 * 50
}
});
expect(wrapper.emitted('on-end')).toBeFalsy();
expect(wrapper.emitted('onEnd')).toBeFalsy();
await sleep(51);
expect(wrapper.emitted('on-end')).toBeTruthy();
expect(wrapper.emitted('onEnd')).toBeTruthy();
});

test('format props', async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/packages/__VUE/elevator/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ test('should list item highlight when clickItem trigger click', async () => {
'nut-elevator__list__item__name--highcolor'
);

expect((wrapper.emitted('click-item') as any)[0][0]).toBe('B');
expect((wrapper.emitted('clickItem') as any)[0][0]).toBe('B');
});

test('clickIndex trigger click', async () => {
Expand All @@ -97,7 +97,7 @@ test('clickIndex trigger click', async () => {
const listItem = wrapper.findAll('.nut-elevator__bars__inner__item')[2];
await listItem.trigger('click');

expect((wrapper.emitted('click-index') as any)[0][0]).toBe('G');
expect((wrapper.emitted('clickIndex') as any)[0][0]).toBe('G');
});

test('index is sticky', async () => {
Expand Down
8 changes: 4 additions & 4 deletions src/packages/__VUE/navbar/__test__/navbar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ test('Navbar: emit click-left & click-right', () => {
});

wrapper.find('.nut-navbar__left').trigger('click');
expect(wrapper.emitted('on-click-back')).toBeTruthy();
expect(wrapper.emitted('onClickBack')).toBeTruthy();
wrapper.find('.nut-navbar__right').trigger('click');
expect(wrapper.emitted('on-click-right')).toBeTruthy();
expect(wrapper.emitted('onClickRight')).toBeTruthy();
wrapper.find('.nut-navbar__title .title').trigger('click');
expect(wrapper.emitted('on-click-title')).toBeTruthy();
expect(wrapper.emitted('onClickTitle')).toBeTruthy();
wrapper.find('.nut-navbar__title .icon').trigger('click');
expect(wrapper.emitted('on-click-icon')).toBeTruthy();
expect(wrapper.emitted('onClickIcon')).toBeTruthy();
});

test('Navbar: should change z-index when using z-index prop', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/noticebar/__tests__/noticebar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ test('across-end event', async () => {
}
});
wrapper.vm.onAnimationEnd();
expect(wrapper.emitted('across-end')).toBeTruthy();
expect(wrapper.emitted('acrossEnd')).toBeTruthy();
});

test('slot event', async () => {
Expand Down
8 changes: 4 additions & 4 deletions src/packages/__VUE/popup/__tests__/popup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ test('event click pop test', async () => {
await nextTick();
const popup: any = wrapper.find('.nut-popup');
await popup.trigger('click');
expect(wrapper.emitted('click-pop')).toBeTruthy();
expect(wrapper.emitted('clickPop')).toBeTruthy();
});

test('event click-close-icon test', async () => {
Expand All @@ -161,7 +161,7 @@ test('event click-close-icon test', async () => {
}
});
await wrapper.find('.nut-popup__close-icon').trigger('click');
expect(wrapper.emitted('click-close-icon')).toBeTruthy();
expect(wrapper.emitted('clickCloseIcon')).toBeTruthy();
});

test('should emit open event when prop visible is set to true', async () => {
Expand All @@ -183,7 +183,7 @@ test('event close test', async () => {
});
await wrapper.find('.nut-overlay').trigger('click');
await nextTick();
expect(wrapper.emitted('click-overlay')).toBeTruthy();
expect(wrapper.emitted('clickOverlay')).toBeTruthy();
});

test('event click-overlay test', async () => {
Expand All @@ -195,5 +195,5 @@ test('event click-overlay test', async () => {

const overlay: any = wrapper.find('.nut-overlay');
await overlay.trigger('click');
expect(wrapper.emitted('click-overlay')).toBeTruthy();
expect(wrapper.emitted('clickOverlay')).toBeTruthy();
});
4 changes: 2 additions & 2 deletions src/packages/__VUE/sku/__tests__/sku.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test('sku select event', async () => {
await nextTick();
const skuItem = wrapper.findAll('.nut-sku-select-item-skus-sku');
skuItem[1].trigger('click');
expect(wrapper.emitted()['select-sku'][0]).toMatchSnapshot();
expect(wrapper.emitted()['selectSku'][0]).toMatchSnapshot();
});

test('do not sell', async () => {
Expand Down Expand Up @@ -55,5 +55,5 @@ test('button event', async () => {
const confirm = wrapper.find('.nut-sku-operate-btn-confirm');
expect(confirm.exists()).toBeTruthy();
confirm.trigger('click');
expect(wrapper.emitted()['click-btn-operate'][0]).toEqual([{ type: 'confirm', value: 1 }]);
expect(wrapper.emitted()['clickBtnOperate'][0]).toEqual([{ type: 'confirm', value: 1 }]);
});
2 changes: 1 addition & 1 deletion src/packages/__VUE/uploader/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ test('should render base uploader other props', async () => {
const toast2 = wrapper.find('.nut-uploader__preview-img__c');
expect(toast2.exists()).toBe(true);
toast2.trigger('click');
expect(wrapper.emitted('file-item-click')).toBeTruthy();
expect(wrapper.emitted('fileItemClick')).toBeTruthy();
expect(toast2.attributes().src).toBe(
'https://m.360buyimg.com/babel/jfs/t1/164410/22/25162/93384/616eac6cE6c711350/0cac53c1b82e1b05.gif'
);
Expand Down
4 changes: 2 additions & 2 deletions src/packages/__VUE/uploader/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export default create({
'change',
'delete',
'update:fileList',
'file-item-click'
'fileItemClick'
],
setup(props, { emit }) {
const fileList = ref(props.fileList as Array<FileItem>);
Expand Down Expand Up @@ -244,7 +244,7 @@ export default create({
};
const fileItemClick = (fileItem: FileItem) => {
emit('file-item-click', { fileItem });
emit('fileItemClick', { fileItem });
};
const executeUpload = (fileItem: FileItem, index: number) => {
Expand Down

0 comments on commit 376a995

Please sign in to comment.