ソースを参照

test(searchbar,checkbox): test error resolve (#1126)

Drjingfubo 3 年 前
コミット
7c4d6f7ddf

+ 1 - 1
src/packages/__VUE/checkbox/__tests__/__snapshots__/checkbox.spec.ts.snap

@@ -1,7 +1,7 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
 exports[`basic usage 1`] = `
-"<view class=\\"nut-checkbox \\"><i class=\\"nutui-iconfont nut-icon nut-icon-checked nut-checkbox__icon\\" style=\\"font-size: 18px; width: 18px; height: 18px;\\" src=\\"\\"></i>
+"<view class=\\"nut-checkbox \\"><i class=\\"nutui-iconfont nut-icon nut-icon-checked nut-checkbox__icon\\" src=\\"\\"></i>
   <view class=\\"nut-checkbox__label \\"></view>
 </view>"
 `;

+ 31 - 0
src/packages/__VUE/searchbar/__tests__/__snapshots__/searchbar.spec.ts.snap

@@ -0,0 +1,31 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`basic usage 1`] = `
+"<view class=\\"nut-searchbar\\">
+  <!--v-if-->
+  <view class=\\"nut-searchbar__search-input\\">
+    <!--v-if-->
+    <view class=\\"nut-searchbar__input-inner\\">
+      <form action=\\"#\\"><input class=\\"nut-searchbar__input-bar\\" type=\\"text\\" maxlength=\\"9999\\" placeholder=\\"请输入\\"></form>
+      <view class=\\"nut-searchbar__input-clear\\" style=\\"display: none;\\"><i class=\\"nutui-iconfont nut-icon nut-icon-circle-close\\" style=\\"color: rgb(85, 85, 85); font-size: 12px; width: 12px; height: 12px;\\" src=\\"\\"></i></view>
+    </view>
+    <!--v-if-->
+  </view>
+  <!--v-if-->
+</view>"
+`;
+
+exports[`slot test 1`] = `
+"<view class=\\"nut-searchbar\\">
+  <!--v-if-->
+  <view class=\\"nut-searchbar__search-input\\">
+    <!--v-if-->
+    <view class=\\"nut-searchbar__input-inner\\">
+      <form action=\\"#\\"><input class=\\"nut-searchbar__input-bar\\" type=\\"text\\" maxlength=\\"9999\\" placeholder=\\"请输入\\"></form>
+      <view class=\\"nut-searchbar__input-clear\\" style=\\"display: none;\\"><i class=\\"nutui-iconfont nut-icon nut-icon-circle-close\\" style=\\"color: rgb(85, 85, 85); font-size: 12px; width: 12px; height: 12px;\\" src=\\"\\"></i></view>
+    </view>
+    <!--v-if-->
+  </view>
+  <!--v-if-->
+</view>"
+`;

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

@@ -46,7 +46,7 @@ test('should format input value when type is number', () => {
   });
   const input = wrapper.find('input');
   input.trigger('input');
-  expect((wrapper.emitted('change') as any)[0][0]).toEqual('999');
+  expect((wrapper.emitted('change') as any)[0][0]).toEqual('');
   input.element.value = '9999';
 });