浏览代码

test(calendar,popover,swipe): test optimization (#1139)

Drjingfubo 3 年之前
父节点
当前提交
51f2dbd989

+ 1 - 1
src/packages/__VUE/calendar/__tests__/calendar.spec.ts

@@ -4,7 +4,7 @@ import { nextTick, toRefs, reactive } from 'vue';
 import Icon from '../../icon/index.vue';
 import Icon from '../../icon/index.vue';
 import PopUp from '../../popup/index.vue';
 import PopUp from '../../popup/index.vue';
 import Button from '../../button/index.vue';
 import Button from '../../button/index.vue';
-import OverLay from '../../overLay/index.vue';
+import OverLay from '../../overlay/index.vue';
 import CalendarItem from '../../calendaritem/index.vue';
 import CalendarItem from '../../calendaritem/index.vue';
 
 
 beforeAll(() => {
 beforeAll(() => {

+ 1 - 0
src/packages/__VUE/circleprogress/demo.vue

@@ -61,6 +61,7 @@ export default createDemo({
     };
     };
     return {
     return {
       progressOption,
       progressOption,
+      strokeInnerWidth,
       isAuto,
       isAuto,
       setAddVal,
       setAddVal,
       setReduceVal,
       setReduceVal,

+ 7 - 6
src/packages/__VUE/popover/__test__/__snapshots__/popover.spec.ts.snap

@@ -7,10 +7,11 @@ exports[`should change icon class prefix when using icon prop 1`] = `
 </view>"
 </view>"
 `;
 `;
 
 
-exports[`should locate to reference element when showed 1`] = `""`;
-
-exports[`should locate to reference element when showed 2`] = `""`;
-
-exports[`should locate to reference element when showed 3`] = `""`;
-
 exports[`should watch placement prop and update location 1`] = `""`;
 exports[`should watch placement prop and update location 1`] = `""`;
+
+exports[`slots 1`] = `
+"<view class=\\"nut-popover nut-popover--light\\">
+  <div></div>
+  <!--v-if-->
+</view>"
+`;

+ 10 - 1
src/packages/__VUE/popover/__test__/popover.spec.ts

@@ -60,7 +60,7 @@ test('should close popover when clicking the list', async () => {
   const wrapper = mount(Popover, {
   const wrapper = mount(Popover, {
     props: {
     props: {
       visible: true,
       visible: true,
-      actions: baseActions
+      list: baseActions
     }
     }
   });
   });
 
 
@@ -92,3 +92,12 @@ test('should change icon class prefix when using icon prop', () => {
 
 
   expect(wrapper.html()).toMatchSnapshot();
   expect(wrapper.html()).toMatchSnapshot();
 });
 });
+test('slots', () => {
+  const wrapper = mount(Popover, {
+    slots: {
+      content: () => 'Custom content'
+    }
+  });
+
+  expect(wrapper.html()).toMatchSnapshot();
+});

+ 3 - 1
src/packages/__VUE/swipe/__tests__/swipe.spec.ts

@@ -3,11 +3,13 @@ import Swipe from '../index.vue';
 import { nextTick } from 'vue';
 import { nextTick } from 'vue';
 import NutButton from '../../button/index.vue';
 import NutButton from '../../button/index.vue';
 import NutCell from '../../cell/index.vue';
 import NutCell from '../../cell/index.vue';
+import NutIcon from '../../icon/index.vue';
 
 
 beforeAll(() => {
 beforeAll(() => {
   config.global.components = {
   config.global.components = {
     NutButton,
     NutButton,
-    NutCell
+    NutCell,
+    NutIcon
   };
   };
 });
 });