Browse Source

test: update test

pull/42762/head
MuxinFeng 1 year ago
parent
commit
a44b35a744
  1. 34
      components/color-picker/__tests__/__snapshots__/demo-extend.test.ts.snap
  2. 126
      components/form/__tests__/__snapshots__/demo-extend.test.ts.snap
  3. 126
      components/form/__tests__/__snapshots__/demo.test.tsx.snap
  4. 4
      components/input-number/index.tsx
  5. 2
      components/watermark/__tests__/__snapshots__/demo-extend.test.ts.snap

34
components/color-picker/__tests__/__snapshots__/demo-extend.test.ts.snap

@ -300,7 +300,7 @@ Array [
</span>
</div>
<div
class="ant-input-number ant-input-number-sm ant-color-picker-steppers ant-color-picker-alpha-input"
class="ant-input-number ant-color-picker-steppers ant-color-picker-alpha-input ant-input-number-sm"
>
<div
class="ant-input-number-handler-wrap"
@ -682,7 +682,7 @@ Array [
</span>
</div>
<div
class="ant-input-number ant-input-number-sm ant-color-picker-steppers ant-color-picker-alpha-input"
class="ant-input-number ant-color-picker-steppers ant-color-picker-alpha-input ant-input-number-sm"
>
<div
class="ant-input-number-handler-wrap"
@ -1064,7 +1064,7 @@ Array [
</span>
</div>
<div
class="ant-input-number ant-input-number-sm ant-color-picker-steppers ant-color-picker-alpha-input"
class="ant-input-number ant-color-picker-steppers ant-color-picker-alpha-input ant-input-number-sm"
>
<div
class="ant-input-number-handler-wrap"
@ -1446,7 +1446,7 @@ Array [
</span>
</div>
<div
class="ant-input-number ant-input-number-sm ant-color-picker-steppers ant-color-picker-alpha-input"
class="ant-input-number ant-color-picker-steppers ant-color-picker-alpha-input ant-input-number-sm"
>
<div
class="ant-input-number-handler-wrap"
@ -1848,7 +1848,7 @@ exports[`renders components/color-picker/demo/format.tsx extend context correctl
</span>
</div>
<div
class="ant-input-number ant-input-number-sm ant-color-picker-steppers ant-color-picker-alpha-input"
class="ant-input-number ant-color-picker-steppers ant-color-picker-alpha-input ant-input-number-sm"
>
<div
class="ant-input-number-handler-wrap"
@ -2247,7 +2247,7 @@ exports[`renders components/color-picker/demo/format.tsx extend context correctl
class="ant-color-picker-hsb-input"
>
<div
class="ant-input-number ant-input-number-sm ant-color-picker-steppers ant-color-picker-hsb-input"
class="ant-input-number ant-color-picker-steppers ant-color-picker-hsb-input ant-input-number-sm"
>
<div
class="ant-input-number-handler-wrap"
@ -2323,7 +2323,7 @@ exports[`renders components/color-picker/demo/format.tsx extend context correctl
</div>
</div>
<div
class="ant-input-number ant-input-number-sm ant-color-picker-steppers ant-color-picker-hsb-input"
class="ant-input-number ant-color-picker-steppers ant-color-picker-hsb-input ant-input-number-sm"
>
<div
class="ant-input-number-handler-wrap"
@ -2399,7 +2399,7 @@ exports[`renders components/color-picker/demo/format.tsx extend context correctl
</div>
</div>
<div
class="ant-input-number ant-input-number-sm ant-color-picker-steppers ant-color-picker-hsb-input"
class="ant-input-number ant-color-picker-steppers ant-color-picker-hsb-input ant-input-number-sm"
>
<div
class="ant-input-number-handler-wrap"
@ -2477,7 +2477,7 @@ exports[`renders components/color-picker/demo/format.tsx extend context correctl
</div>
</div>
<div
class="ant-input-number ant-input-number-sm ant-color-picker-steppers ant-color-picker-alpha-input"
class="ant-input-number ant-color-picker-steppers ant-color-picker-alpha-input ant-input-number-sm"
>
<div
class="ant-input-number-handler-wrap"
@ -2875,7 +2875,7 @@ exports[`renders components/color-picker/demo/format.tsx extend context correctl
class="ant-color-picker-rgb-input"
>
<div
class="ant-input-number ant-input-number-sm ant-color-picker-steppers ant-color-picker-rgb-input"
class="ant-input-number ant-color-picker-steppers ant-color-picker-rgb-input ant-input-number-sm"
>
<div
class="ant-input-number-handler-wrap"
@ -2951,7 +2951,7 @@ exports[`renders components/color-picker/demo/format.tsx extend context correctl
</div>
</div>
<div
class="ant-input-number ant-input-number-sm ant-color-picker-steppers ant-color-picker-rgb-input"
class="ant-input-number ant-color-picker-steppers ant-color-picker-rgb-input ant-input-number-sm"
>
<div
class="ant-input-number-handler-wrap"
@ -3027,7 +3027,7 @@ exports[`renders components/color-picker/demo/format.tsx extend context correctl
</div>
</div>
<div
class="ant-input-number ant-input-number-sm ant-color-picker-steppers ant-color-picker-rgb-input"
class="ant-input-number ant-color-picker-steppers ant-color-picker-rgb-input ant-input-number-sm"
>
<div
class="ant-input-number-handler-wrap"
@ -3105,7 +3105,7 @@ exports[`renders components/color-picker/demo/format.tsx extend context correctl
</div>
</div>
<div
class="ant-input-number ant-input-number-sm ant-color-picker-steppers ant-color-picker-alpha-input"
class="ant-input-number ant-color-picker-steppers ant-color-picker-alpha-input ant-input-number-sm"
>
<div
class="ant-input-number-handler-wrap"
@ -3504,7 +3504,7 @@ Array [
</span>
</div>
<div
class="ant-input-number ant-input-number-sm ant-color-picker-steppers ant-color-picker-alpha-input"
class="ant-input-number ant-color-picker-steppers ant-color-picker-alpha-input ant-input-number-sm"
>
<div
class="ant-input-number-handler-wrap"
@ -4263,7 +4263,7 @@ exports[`renders components/color-picker/demo/pure-panel.tsx extend context corr
</span>
</div>
<div
class="ant-input-number ant-input-number-sm ant-color-picker-steppers ant-color-picker-alpha-input"
class="ant-input-number ant-color-picker-steppers ant-color-picker-alpha-input ant-input-number-sm"
>
<div
class="ant-input-number-handler-wrap"
@ -4643,7 +4643,7 @@ Array [
</span>
</div>
<div
class="ant-input-number ant-input-number-sm ant-color-picker-steppers ant-color-picker-alpha-input"
class="ant-input-number ant-color-picker-steppers ant-color-picker-alpha-input ant-input-number-sm"
>
<div
class="ant-input-number-handler-wrap"
@ -5025,7 +5025,7 @@ Array [
</span>
</div>
<div
class="ant-input-number ant-input-number-sm ant-color-picker-steppers ant-color-picker-alpha-input"
class="ant-input-number ant-color-picker-steppers ant-color-picker-alpha-input ant-input-number-sm"
>
<div
class="ant-input-number-handler-wrap"

126
components/form/__tests__/__snapshots__/demo-extend.test.ts.snap

@ -8891,14 +8891,14 @@ exports[`renders components/form/demo/register.tsx extend context correctly 1`]
class="ant-form-item-control-input-content"
>
<div
class="ant-input-number-group-wrapper"
class="ant-input-number-group-wrapper ant-input-number-in-form-item"
style="width: 100%;"
>
<div
class="ant-input-number-wrapper ant-input-number-group"
>
<div
class="ant-input-number ant-input-number-in-form-item"
class="ant-input-number"
>
<div
class="ant-input-number-handler-wrap"
@ -26512,96 +26512,54 @@ exports[`renders components/form/demo/validate-static.tsx extend context correct
class="ant-form-item-control-input-content"
>
<div
class="ant-input-number-affix-wrapper ant-input-number-affix-wrapper-status-success ant-input-number-affix-wrapper-has-feedback"
class="ant-input-number ant-input-number-in-form-item ant-input-number-status-success"
style="width: 100%;"
>
<div
class="ant-input-number ant-input-number-in-form-item ant-input-number-status-success"
class="ant-input-number-handler-wrap"
>
<div
class="ant-input-number-handler-wrap"
<span
aria-disabled="false"
aria-label="Increase Value"
class="ant-input-number-handler ant-input-number-handler-up"
role="button"
unselectable="on"
>
<span
aria-disabled="false"
aria-label="Increase Value"
class="ant-input-number-handler ant-input-number-handler-up"
role="button"
unselectable="on"
>
<span
aria-label="up"
class="anticon anticon-up ant-input-number-handler-up-inner"
role="img"
>
<svg
aria-hidden="true"
data-icon="up"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"
/>
</svg>
</span>
</span>
<span
aria-disabled="false"
aria-label="Decrease Value"
class="ant-input-number-handler ant-input-number-handler-down"
role="button"
unselectable="on"
aria-label="up"
class="anticon anticon-up ant-input-number-handler-up-inner"
role="img"
>
<span
aria-label="down"
class="anticon anticon-down ant-input-number-handler-down-inner"
role="img"
<svg
aria-hidden="true"
data-icon="up"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<svg
aria-hidden="true"
data-icon="down"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
/>
</svg>
</span>
<path
d="M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"
/>
</svg>
</span>
</div>
<div
class="ant-input-number-input-wrap"
>
<input
autocomplete="off"
class="ant-input-number-input"
role="spinbutton"
step="1"
value=""
/>
</div>
</div>
<span
class="ant-input-number-suffix"
>
</span>
<span
class="ant-form-item-feedback-icon ant-form-item-feedback-icon-success"
aria-disabled="false"
aria-label="Decrease Value"
class="ant-input-number-handler ant-input-number-handler-down"
role="button"
unselectable="on"
>
<span
aria-label="check-circle"
class="anticon anticon-check-circle"
aria-label="down"
class="anticon anticon-down ant-input-number-handler-down-inner"
role="img"
>
<svg
aria-hidden="true"
data-icon="check-circle"
data-icon="down"
fill="currentColor"
focusable="false"
height="1em"
@ -26609,12 +26567,24 @@ exports[`renders components/form/demo/validate-static.tsx extend context correct
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
/>
</svg>
</span>
</span>
</span>
</div>
<div
class="ant-input-number-input-wrap"
>
<input
autocomplete="off"
class="ant-input-number-input"
role="spinbutton"
step="1"
suffix="[object Object]"
value=""
/>
</div>
</div>
</div>
</div>

126
components/form/__tests__/__snapshots__/demo.test.tsx.snap

@ -5976,14 +5976,14 @@ exports[`renders components/form/demo/register.tsx correctly 1`] = `
class="ant-form-item-control-input-content"
>
<div
class="ant-input-number-group-wrapper"
class="ant-input-number-group-wrapper ant-input-number-in-form-item"
style="width:100%"
>
<div
class="ant-input-number-wrapper ant-input-number-group"
>
<div
class="ant-input-number ant-input-number-in-form-item"
class="ant-input-number"
>
<div
class="ant-input-number-handler-wrap"
@ -10920,96 +10920,54 @@ exports[`renders components/form/demo/validate-static.tsx correctly 1`] = `
class="ant-form-item-control-input-content"
>
<div
class="ant-input-number-affix-wrapper ant-input-number-affix-wrapper-status-success ant-input-number-affix-wrapper-has-feedback"
class="ant-input-number ant-input-number-in-form-item ant-input-number-status-success"
style="width:100%"
>
<div
class="ant-input-number ant-input-number-in-form-item ant-input-number-status-success"
class="ant-input-number-handler-wrap"
>
<div
class="ant-input-number-handler-wrap"
<span
aria-disabled="false"
aria-label="Increase Value"
class="ant-input-number-handler ant-input-number-handler-up"
role="button"
unselectable="on"
>
<span
aria-disabled="false"
aria-label="Increase Value"
class="ant-input-number-handler ant-input-number-handler-up"
role="button"
unselectable="on"
>
<span
aria-label="up"
class="anticon anticon-up ant-input-number-handler-up-inner"
role="img"
>
<svg
aria-hidden="true"
data-icon="up"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"
/>
</svg>
</span>
</span>
<span
aria-disabled="false"
aria-label="Decrease Value"
class="ant-input-number-handler ant-input-number-handler-down"
role="button"
unselectable="on"
aria-label="up"
class="anticon anticon-up ant-input-number-handler-up-inner"
role="img"
>
<span
aria-label="down"
class="anticon anticon-down ant-input-number-handler-down-inner"
role="img"
<svg
aria-hidden="true"
data-icon="up"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<svg
aria-hidden="true"
data-icon="down"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
/>
</svg>
</span>
<path
d="M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"
/>
</svg>
</span>
</div>
<div
class="ant-input-number-input-wrap"
>
<input
autocomplete="off"
class="ant-input-number-input"
role="spinbutton"
step="1"
value=""
/>
</div>
</div>
<span
class="ant-input-number-suffix"
>
</span>
<span
class="ant-form-item-feedback-icon ant-form-item-feedback-icon-success"
aria-disabled="false"
aria-label="Decrease Value"
class="ant-input-number-handler ant-input-number-handler-down"
role="button"
unselectable="on"
>
<span
aria-label="check-circle"
class="anticon anticon-check-circle"
aria-label="down"
class="anticon anticon-down ant-input-number-handler-down-inner"
role="img"
>
<svg
aria-hidden="true"
data-icon="check-circle"
data-icon="down"
fill="currentColor"
focusable="false"
height="1em"
@ -11017,12 +10975,24 @@ exports[`renders components/form/demo/validate-static.tsx correctly 1`] = `
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
/>
</svg>
</span>
</span>
</span>
</div>
<div
class="ant-input-number-input-wrap"
>
<input
autocomplete="off"
class="ant-input-number-input"
role="spinbutton"
step="1"
suffix="[object Object]"
value=""
/>
</div>
</div>
</div>
</div>

4
components/input-number/index.tsx

@ -108,7 +108,7 @@ const InputNumber = React.forwardRef<HTMLInputElement, InputNumberProps>((props,
<RcInputNumber
ref={inputRef}
disabled={mergedDisabled}
className={classNames(className, rootClassName, compactItemClassnames)}
className={inputNumberClass}
upHandler={upIcon}
downHandler={downIcon}
prefixCls={prefixCls}
@ -135,7 +135,7 @@ const InputNumber = React.forwardRef<HTMLInputElement, InputNumberProps>((props,
)
}
classNames={{
input: inputNumberClass,
input: classNames(className, rootClassName, compactItemClassnames),
}}
classes={{
affixWrapper: classNames(

2
components/watermark/__tests__/__snapshots__/demo-extend.test.ts.snap

@ -413,7 +413,7 @@ exports[`renders components/watermark/demo/custom.tsx extend context correctly 1
</span>
</div>
<div
class="ant-input-number ant-input-number-sm ant-input-number-in-form-item ant-color-picker-steppers ant-color-picker-alpha-input"
class="ant-input-number ant-color-picker-steppers ant-color-picker-alpha-input ant-input-number-sm ant-input-number-in-form-item"
>
<div
class="ant-input-number-handler-wrap"

Loading…
Cancel
Save