Skip to content

Commit 6915342

Browse files
zombieJclaude
andauthored
test: update demo for image diff (ant-design#56976)
* chore: update @rc-component/select to v1.6.7 and update debug demo Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test: update Input component snapshots Add updated snapshot tests for input component demo and demo-extend. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: bump deps * chore: trigger CI re-run * chore: format --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 956c1d1 commit 6915342

6 files changed

Lines changed: 172 additions & 17 deletions

File tree

components/input/__tests__/__snapshots__/demo-extend.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3146,7 +3146,7 @@ Array [
31463146
style="width: 100px;"
31473147
>
31483148
<div
3149-
class="ant-select-content ant-select-content-has-value"
3149+
class="ant-select-content"
31503150
title=""
31513151
>
31523152
<input

components/input/__tests__/__snapshots__/demo.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ Array [
684684
style="width:100px"
685685
>
686686
<div
687-
class="ant-select-content ant-select-content-has-value"
687+
class="ant-select-content"
688688
title=""
689689
>
690690
<input

components/select/__tests__/__snapshots__/demo-extend.test.ts.snap

Lines changed: 112 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,9 @@ Array [
17781778
exports[`renders components/select/demo/custom-tag-render.tsx extend context correctly 2`] = `[]`;
17791779

17801780
exports[`renders components/select/demo/debug.tsx extend context correctly 1`] = `
1781-
Array [
1781+
<div
1782+
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-middle ant-flex-vertical"
1783+
>
17821784
<div
17831785
class="ant-space ant-space-horizontal ant-space-align-center ant-space-gap-row-small ant-space-gap-col-small css-var-test-id"
17841786
style="flex-wrap: wrap; width: 500px; position: relative; z-index: 1; border: 1px solid red; background-color: rgb(255, 255, 255);"
@@ -2210,9 +2212,9 @@ Array [
22102212
</span>
22112213
</button>
22122214
</div>
2213-
</div>,
2215+
</div>
22142216
<div
2215-
style="width: 200px; margin-top: 24px;"
2217+
style="width: 200px;"
22162218
>
22172219
<div
22182220
class="ant-select ant-select-outlined css-var-test-id ant-select-css-var ant-select-multiple ant-select-show-arrow ant-select-show-search"
@@ -2379,8 +2381,113 @@ Array [
23792381
</div>
23802382
</div>
23812383
</div>
2382-
</div>,
2383-
]
2384+
</div>
2385+
<div
2386+
class="ant-select ant-select-outlined css-var-test-id ant-select-css-var ant-select-single ant-select-show-arrow"
2387+
>
2388+
<div
2389+
class="ant-select-content"
2390+
title=""
2391+
>
2392+
<input
2393+
aria-autocomplete="list"
2394+
aria-expanded="false"
2395+
aria-haspopup="listbox"
2396+
autocomplete="off"
2397+
class="ant-select-input"
2398+
id="test-id"
2399+
readonly=""
2400+
role="combobox"
2401+
type="search"
2402+
value=""
2403+
/>
2404+
</div>
2405+
<div
2406+
class="ant-select-suffix"
2407+
>
2408+
<span
2409+
aria-label="down"
2410+
class="anticon anticon-down"
2411+
role="img"
2412+
>
2413+
<svg
2414+
aria-hidden="true"
2415+
data-icon="down"
2416+
fill="currentColor"
2417+
focusable="false"
2418+
height="1em"
2419+
viewBox="64 64 896 896"
2420+
width="1em"
2421+
>
2422+
<path
2423+
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"
2424+
/>
2425+
</svg>
2426+
</span>
2427+
</div>
2428+
</div>
2429+
<div
2430+
class="ant-select-dropdown ant-slide-up-appear ant-slide-up-appear-prepare ant-slide-up css-var-test-id ant-select-css-var ant-select-dropdown-empty ant-select-dropdown-placement-bottomLeft"
2431+
style="--arrow-x: 0px; --arrow-y: 0px; left: -1000vw; top: -1000vh; right: auto; bottom: auto; box-sizing: border-box;"
2432+
>
2433+
<div>
2434+
<div
2435+
class="ant-select-item-empty"
2436+
id="test-id_list"
2437+
role="listbox"
2438+
>
2439+
<div
2440+
class="css-var-test-id ant-empty ant-empty-normal ant-empty-small"
2441+
>
2442+
<div
2443+
class="ant-empty-image"
2444+
>
2445+
<svg
2446+
height="41"
2447+
viewBox="0 0 64 41"
2448+
width="64"
2449+
xmlns="http://www.w3.org/2000/svg"
2450+
>
2451+
<title>
2452+
No data
2453+
</title>
2454+
<g
2455+
fill="none"
2456+
fill-rule="evenodd"
2457+
transform="translate(0 1)"
2458+
>
2459+
<ellipse
2460+
cx="32"
2461+
cy="33"
2462+
fill="#f5f5f5"
2463+
rx="32"
2464+
ry="7"
2465+
/>
2466+
<g
2467+
fill-rule="nonzero"
2468+
stroke="#d9d9d9"
2469+
>
2470+
<path
2471+
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
2472+
/>
2473+
<path
2474+
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
2475+
fill="#fafafa"
2476+
/>
2477+
</g>
2478+
</g>
2479+
</svg>
2480+
</div>
2481+
<div
2482+
class="ant-empty-description"
2483+
>
2484+
No data
2485+
</div>
2486+
</div>
2487+
</div>
2488+
</div>
2489+
</div>
2490+
</div>
23842491
`;
23852492

23862493
exports[`renders components/select/demo/debug.tsx extend context correctly 2`] = `[]`;

components/select/__tests__/__snapshots__/demo.test.tsx.snap

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,9 @@ exports[`renders components/select/demo/custom-tag-render.tsx correctly 1`] = `
741741
`;
742742

743743
exports[`renders components/select/demo/debug.tsx correctly 1`] = `
744-
Array [
744+
<div
745+
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-middle ant-flex-vertical"
746+
>
745747
<div
746748
class="ant-space ant-space-horizontal ant-space-align-center ant-space-gap-row-small ant-space-gap-col-small css-var-test-id"
747749
style="flex-wrap:wrap;width:500px;position:relative;z-index:1;border:1px solid red;background-color:#fff"
@@ -924,9 +926,9 @@ Array [
924926
</span>
925927
</button>
926928
</div>
927-
</div>,
929+
</div>
928930
<div
929-
style="width:200px;margin-top:24px"
931+
style="width:200px"
930932
>
931933
<div
932934
class="ant-select ant-select-outlined css-var-test-id ant-select-css-var ant-select-multiple ant-select-show-arrow ant-select-show-search"
@@ -1018,8 +1020,52 @@ Array [
10181020
</span>
10191021
</div>
10201022
</div>
1021-
</div>,
1022-
]
1023+
</div>
1024+
<div
1025+
class="ant-select ant-select-outlined css-var-test-id ant-select-css-var ant-select-single ant-select-show-arrow"
1026+
>
1027+
<div
1028+
class="ant-select-content"
1029+
title=""
1030+
>
1031+
<input
1032+
aria-autocomplete="list"
1033+
aria-expanded="false"
1034+
aria-haspopup="listbox"
1035+
autocomplete="off"
1036+
class="ant-select-input"
1037+
id="test-id"
1038+
readonly=""
1039+
role="combobox"
1040+
type="search"
1041+
value=""
1042+
/>
1043+
</div>
1044+
<div
1045+
class="ant-select-suffix"
1046+
>
1047+
<span
1048+
aria-label="down"
1049+
class="anticon anticon-down"
1050+
role="img"
1051+
>
1052+
<svg
1053+
aria-hidden="true"
1054+
data-icon="down"
1055+
fill="currentColor"
1056+
focusable="false"
1057+
height="1em"
1058+
viewBox="64 64 896 896"
1059+
width="1em"
1060+
>
1061+
<path
1062+
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"
1063+
/>
1064+
</svg>
1065+
</span>
1066+
</div>
1067+
</div>
1068+
</div>
10231069
`;
10241070

10251071
exports[`renders components/select/demo/debug-flip-shift.tsx correctly 1`] = `

components/select/demo/debug.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Button, Input, Select, Space } from 'antd';
2+
import { Button, Flex, Input, Select, Space } from 'antd';
33

44
const style: React.CSSProperties = {
55
width: 500,
@@ -14,7 +14,7 @@ const handleChange = (value: string | string[]) => {
1414
};
1515

1616
const App: React.FC = () => (
17-
<>
17+
<Flex vertical gap="middle">
1818
<Space style={style} wrap>
1919
<Input style={{ width: 100 }} value="222" />
2020
<Select
@@ -48,7 +48,7 @@ const App: React.FC = () => (
4848
<span className="debug-align">AntDesign</span>
4949
<Button>222</Button>
5050
</Space>
51-
<div style={{ width: 200, marginTop: 24 }}>
51+
<div style={{ width: 200 }}>
5252
{/* https://github.com/ant-design/ant-design/issues/54179 */}
5353
<Select
5454
mode="multiple"
@@ -62,7 +62,9 @@ const App: React.FC = () => (
6262
]}
6363
/>
6464
</div>
65-
</>
65+
66+
<Select defaultValue="" />
67+
</Flex>
6668
);
6769

6870
export default App;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
"@rc-component/rate": "~1.0.1",
137137
"@rc-component/resize-observer": "^1.1.1",
138138
"@rc-component/segmented": "~1.3.0",
139-
"@rc-component/select": "~1.6.7",
139+
"@rc-component/select": "~1.6.8",
140140
"@rc-component/slider": "~1.0.1",
141141
"@rc-component/steps": "~1.2.2",
142142
"@rc-component/switch": "~1.0.3",

0 commit comments

Comments
 (0)