Skip to content

Commit

Permalink
test: addrss
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyatong committed Dec 24, 2024
1 parent 307fc95 commit f565985
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ exports[`Address: exist defaultIcon & selectIcon 1`] = `"<div class="nut-overlay

exports[`Address: show custom 1`] = `"<div class="nut-overlay" style="--nutui-overlay-zIndex: 1000;"></div><div style="z-index: 1000;" class="nut-popup nut-popup-round nut-popup-bottom"><div class="nut-popup-title"><div class="nut-popup-title-wrapper"><div class="nut-popup-title-title">选择地址</div></div><div class="nut-popup-title-right nut-popup-title-right-top-right"><svg class="nut-icon nut-icon-Close " xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" aria-labelledby="Close" role="presentation"><path d="m512 557.23 279.25 279.25c4.27 4.27 10.88 4.27 14.94 0l30.29-30.29c4.27-4.27 4.27-10.88 0-14.94L557.23 512l279.25-279.25c4.27-4.27 4.27-10.88 0-14.94l-30.29-30.29c-4.27-4.27-10.88-4.27-14.94 0L512 466.77 232.75 187.52c-4.27-4.27-10.88-4.27-14.94 0l-30.29 30.29c-4.27 4.27-4.27 10.88 0 14.94L466.77 512 187.52 791.25c-4.27 4.27-4.27 10.88 0 14.94l30.29 30.29c4.27 4.27 10.88 4.27 14.94 0z" fill="currentColor" fill-opacity="0.9"></path></svg></div></div><div class="nut-cascader "><div class="nut-tabs nut-tabs-horizontal"><div class="nut-tabs-titles nut-tabs-titles-line nut-tabs-titles-scrollable"><div class="nut-tabs-titles-item nut-tabs-titles-item-active"><span class="nut-tabs-titles-item-text">请选择</span><span class="nut-tabs-titles-item-line"></span></div></div><div class="nut-tabs-content-wrap"><div class="nut-tabs-content" style="transform: translate3d(-0%, 0, 0); transition-duration: 300ms;"><div class="nut-tabpane active"><div class="nut-cascader-pane"><div class="nut-cascader-item"><div class="nut-cascader-item-title">浙江</div></div><div class="disabled nut-cascader-item"><div class="nut-cascader-item-title">湖南</div></div><div class="nut-cascader-item"><div class="nut-cascader-item-title">福建</div></div></div></div></div></div></div></div></div>"`;

exports[`Address: show custom 2`] = `"<div class="nut-overlay" style="--nutui-overlay-zIndex: 1000;"></div><div style="z-index: 1000;" class="nut-popup nut-popup-round nut-popup-bottom"><div class="nut-popup-title"><div class="nut-popup-title-left"><div class="nut-address-left-icon"><svg class="nut-icon nut-icon-ArrowLeft " style="color: #cccccc;" xmlns="http://www.w3.org/2000/svg" color="#cccccc" viewBox="0 0 1024 1024" aria-labelledby="ArrowLeft" role="presentation"><path d="M661.33 153.81a10.67 10.67 0 0 0-18.13-7.68L277.33 512 643.2 877.87a10.67 10.67 0 0 0 18.13-7.68v-60.38a10.03 10.03 0 0 0-3.2-7.46L367.79 512l290.34-290.35a10.88 10.88 0 0 0 3.2-7.46z" fill="currentColor" fill-opacity="0.9"></path></svg></div></div><div class="nut-popup-title-wrapper"><div class="nut-popup-title-title">选择地址</div></div><div class="nut-popup-title-right nut-popup-title-right-top-right"><svg class="nut-icon nut-icon-Close " xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" aria-labelledby="Close" role="presentation"><path d="m512 557.23 279.25 279.25c4.27 4.27 10.88 4.27 14.94 0l30.29-30.29c4.27-4.27 4.27-10.88 0-14.94L557.23 512l279.25-279.25c4.27-4.27 4.27-10.88 0-14.94l-30.29-30.29c-4.27-4.27-10.88-4.27-14.94 0L512 466.77 232.75 187.52c-4.27-4.27-10.88-4.27-14.94 0l-30.29 30.29c-4.27 4.27-4.27 10.88 0 14.94L466.77 512 187.52 791.25c-4.27 4.27-4.27 10.88 0 14.94l30.29 30.29c4.27 4.27 10.88 4.27 14.94 0z" fill="currentColor" fill-opacity="0.9"></path></svg></div></div><div class="nut-cascader "><div class="nut-tabs nut-tabs-horizontal"><div class="nut-tabs-titles nut-tabs-titles-line nut-tabs-titles-scrollable"><div class="nut-tabs-titles-item nut-tabs-titles-item-active"><span class="nut-tabs-titles-item-text">请选择</span><span class="nut-tabs-titles-item-line"></span></div></div><div class="nut-tabs-content-wrap"><div class="nut-tabs-content" style="transform: translate3d(-0%, 0, 0); transition-duration: 300ms;"><div class="nut-tabpane active"><div class="nut-cascader-pane"><div class="nut-cascader-item"><div class="nut-cascader-item-title">浙江</div></div><div class="disabled nut-cascader-item"><div class="nut-cascader-item-title">湖南</div></div><div class="nut-cascader-item"><div class="nut-cascader-item-title">福建</div></div></div></div></div></div></div></div></div>"`;

exports[`Address: show exist 1`] = `"<div class="nut-overlay" style="--nutui-overlay-zIndex: 1000;"></div><div style="z-index: 1000;" class="nut-popup nut-popup-round nut-popup-bottom"><div class="nut-popup-title"><div class="nut-popup-title-wrapper"><div class="nut-popup-title-title">选择地址</div></div><div class="nut-popup-title-right nut-popup-title-right-top-right"><svg class="nut-icon nut-icon-Close " xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" aria-labelledby="Close" role="presentation"><path d="m512 557.23 279.25 279.25c4.27 4.27 10.88 4.27 14.94 0l30.29-30.29c4.27-4.27 4.27-10.88 0-14.94L557.23 512l279.25-279.25c4.27-4.27 4.27-10.88 0-14.94l-30.29-30.29c-4.27-4.27-10.88-4.27-14.94 0L512 466.77 232.75 187.52c-4.27-4.27-10.88-4.27-14.94 0l-30.29 30.29c-4.27 4.27-4.27 10.88 0 14.94L466.77 512 187.52 791.25c-4.27 4.27-4.27 10.88 0 14.94l30.29 30.29c4.27 4.27 10.88 4.27 14.94 0z" fill="currentColor" fill-opacity="0.9"></path></svg></div></div><div class="nut-address "><ul class="nut-address-exist"><li class="nut-address-exist-item active"><svg class="nut-icon nut-icon-Check " style="color: var(--nutui-color-primary);" xmlns="http://www.w3.org/2000/svg" color="var(--nutui-color-primary)" viewBox="0 0 49 48" aria-labelledby="Check" role="presentation"><path d="M45.121 16.121 47.243 14 43 9.757l-2.121 2.122L19 33.757 7.121 21.88 5 19.757.757 24l2.122 2.121L14.757 38l2.122 2.121L19 42.243l2.121-2.122L23.243 38z" fill="currentColor" fill-opacity="0.9"></path></svg><div class="nut-address-exist-item-info"><div>探探鱼</div><div>182****1718</div><div>北京市次渠镇通州区</div></div></li><li class="nut-address-exist-item "><svg class="nut-icon nut-icon-Location " xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" aria-labelledby="Location" role="presentation"><path d="M533.33 1024s448-232.53 448-576c0-247.47-200.53-448-448-448s-448 200.53-448 448c0 343.47 448 576 448 576m181.12-206.72c-52.91 47.57-105.81 85.33-145.92 111.36a893 893 0 0 1-35.2 21.76 1148.8 1148.8 0 0 1-181.12-133.12C244.05 719.79 149.33 591.79 149.33 448c0-212.05 171.95-384 384-384s384 171.95 384 384c0 143.79-94.72 271.79-202.88 369.28M533.33 640a192 192 0 1 0-.02-384.02 192 192 0 0 0 .02 384.02m0-64c-70.61 0-128-57.39-128-128s57.39-128 128-128 128 57.39 128 128-57.39 128-128 128" fill="currentColor" fill-opacity="0.9"></path></svg><div class="nut-address-exist-item-info"><div>探探鱼</div><div>182****1718</div><div>钓鱼岛钓鱼岛全区</div></div></li><li class="nut-address-exist-item "><svg class="nut-icon nut-icon-Location " xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" aria-labelledby="Location" role="presentation"><path d="M533.33 1024s448-232.53 448-576c0-247.47-200.53-448-448-448s-448 200.53-448 448c0 343.47 448 576 448 576m181.12-206.72c-52.91 47.57-105.81 85.33-145.92 111.36a893 893 0 0 1-35.2 21.76 1148.8 1148.8 0 0 1-181.12-133.12C244.05 719.79 149.33 591.79 149.33 448c0-212.05 171.95-384 384-384s384 171.95 384 384c0 143.79-94.72 271.79-202.88 369.28M533.33 640a192 192 0 1 0-.02-384.02 192 192 0 0 0 .02 384.02m0-64c-70.61 0-128-57.39-128-128s57.39-128 128-128 128 57.39 128 128-57.39 128-128 128" fill="currentColor" fill-opacity="0.9"></path></svg><div class="nut-address-exist-item-info"><div>探探鱼</div><div>182****1718</div><div>北京市大兴区科创十一街18号院京东大厦</div></div></li></ul></div></div>"`;
7 changes: 7 additions & 0 deletions src/packages/address/__test__/address.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ test('Address: show custom', async () => {
expect(container.innerHTML).toMatchSnapshot()
})

test('Address: show custom', async () => {
const { container } = render(
<Address visible options={optionsDemo1} custom title="选择地址" />
)
expect(container.innerHTML).toMatchSnapshot()
})

test('Address: options disabled', async () => {
const { container } = render(<Address visible options={optionsDemo1} />)
const items = container.querySelectorAll('.nut-cascader-item')
Expand Down

0 comments on commit f565985

Please sign in to comment.