Browse Source

fix: 修改

Drjnigfubo 3 years ago
parent
commit
a659c96cdb

+ 4 - 2
src/packages/__VUE/avatar/__tests__/avatar.spec.ts

@@ -12,7 +12,7 @@ afterAll(() => {
   config.global.components = {};
 });
 
-test('size props', () => {
+test('size props', async () => {
   const wrapper = mount(Avatar, {
     props: {
       size: 'small'
@@ -20,12 +20,14 @@ test('size props', () => {
   });
   const avatar: any = wrapper.find('.nut-avatar');
   expect(avatar.classes()).toContain('avatar-small');
+  await wrapper.setProps({ size: 'large' });
+  expect(avatar.classes()).toContain('avatar-large');
 });
 
 test('shape props', () => {
   const wrapper = mount(Avatar, {
     props: {
-      size: 'square'
+      shape: 'square'
     }
   });
   const avatar: any = wrapper.find('.nut-avatar');

+ 0 - 5
src/packages/__VUE/swiper/__tests__/index.spec.ts

@@ -76,7 +76,6 @@ test('should render initpage', async () => {
   });
 
   await nextTick();
-  await nextTick();
 
   const swiperItem = wrapper.findAll('.nut-swiper-inner')[0].element as HTMLElement;
 
@@ -114,7 +113,6 @@ test('should render direction', async () => {
   });
 
   await nextTick();
-  await nextTick();
 
   const swiperItem = wrapper.findAll('.nut-swiper-inner')[0].element as HTMLElement;
 
@@ -152,7 +150,6 @@ test('should render pagination', async () => {
   });
 
   await nextTick();
-  await nextTick();
 
   const swiperPagination = wrapper.find('.nut-swiper-pagination');
   expect(swiperPagination.exists()).toBe(true);
@@ -199,7 +196,6 @@ test('should render loop and auto-play', async () => {
   });
 
   await nextTick();
-  await nextTick();
 
   await sleep(200);
   const swiperItem = wrapper.findAll('.nut-swiper-inner')[0].element as HTMLElement;
@@ -261,7 +257,6 @@ test('should not allow to drag when loop is false', async () => {
   });
 
   await nextTick();
-  await nextTick();
 
   await sleep(2000);
   expect(wrapper.vm.page).toBe(3);