Skip to content

Commit

Permalink
refactor(image): finish (#561)
Browse files Browse the repository at this point in the history
* refactor(image): finish

* chore: update common

* test(image): update

* test: update snapshot
  • Loading branch information
LeeJim authored and anlyyao committed Apr 7, 2023
1 parent 42ebe6b commit 2604955
Show file tree
Hide file tree
Showing 29 changed files with 4,262 additions and 3,158 deletions.
4,316 changes: 2,774 additions & 1,542 deletions src/avatar/__test__/__snapshots__/demo.test.jsx.snap

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/avatar/__test__/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('avatar', () => {
const onError = vi.fn();
const wrapper = mount(() => <Avatar image={IMAGE_FAIL} alt="加载错误" onError={onError} />);
const img = wrapper.find('img');
const status = wrapper.find(`.t-image__status`);
const status = wrapper.find(`.t-image__mask`);
expect(status.exists()).toBeTruthy();
expect(img.exists()).toBeTruthy();
await img.trigger('error');
Expand Down
112 changes: 72 additions & 40 deletions src/cell/__test__/__snapshots__/demo.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -897,31 +897,47 @@ exports[`Cell > Cell mobileVue demo works fine 1`] = `
class="t-avatar__inner"
>
<div
class="t-image t-image--round"
class="t-image t-image--square"
>
<div
class="t-image__status"
class="t-image__mask"
>
<svg
class="t-icon t-icon-ellipsis"
fill="none"
height="1em"
viewBox="0 0 16 16"
width="1em"
<div
class="t-loading"
style="font-size: 20px;"
>
<path
d="M3 9a1 1 0 110-2 1 1 0 010 2zM7 8a1 1 0 102 0 1 1 0 00-2 0zM12 8a1 1 0 102 0 1 1 0 00-2 0z"
fill="currentColor"
fill-opacity="0.9"
/>
</svg>
<div
class="t-loading__dots"
style="animation-duration: 800ms; width: 20px; height: 20px;"
>
<div
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay: 0s;"
/>
<div
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay: 0.26666666666666666s;"
/>
<div
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay: 0.5333333333333333s;"
/>
</div>
<!--v-if-->
<!---->
</div>
</div>
<img
alt=""
class="t-image__img"
src="https://tdesign.gtimg.com/mobile/demos/avatar_1.png"
style="object-fit: fill; object-position: center;"
/>
<picture>
<!--v-if-->
<img
alt=""
class="t-image__img"
src="https://tdesign.gtimg.com/mobile/demos/avatar_1.png"
style="object-fit: fill; object-position: center;"
/>
</picture>
</div>
</div>
<!--v-if-->
Expand Down Expand Up @@ -1575,31 +1591,47 @@ exports[`Cell > Cell multipleVue demo works fine 1`] = `
class="t-avatar__inner"
>
<div
class="t-image t-image--round"
class="t-image t-image--square"
>
<div
class="t-image__status"
class="t-image__mask"
>
<svg
class="t-icon t-icon-ellipsis"
fill="none"
height="1em"
viewBox="0 0 16 16"
width="1em"
<div
class="t-loading"
style="font-size: 20px;"
>
<path
d="M3 9a1 1 0 110-2 1 1 0 010 2zM7 8a1 1 0 102 0 1 1 0 00-2 0zM12 8a1 1 0 102 0 1 1 0 00-2 0z"
fill="currentColor"
fill-opacity="0.9"
/>
</svg>
<div
class="t-loading__dots"
style="animation-duration: 800ms; width: 20px; height: 20px;"
>
<div
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay: 0s;"
/>
<div
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay: 0.26666666666666666s;"
/>
<div
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay: 0.5333333333333333s;"
/>
</div>
<!--v-if-->
<!---->
</div>
</div>
<img
alt=""
class="t-image__img"
src="https://tdesign.gtimg.com/mobile/demos/avatar_1.png"
style="object-fit: fill; object-position: center;"
/>
<picture>
<!--v-if-->
<img
alt=""
class="t-image__img"
src="https://tdesign.gtimg.com/mobile/demos/avatar_1.png"
style="object-fit: fill; object-position: center;"
/>
</picture>
</div>
</div>
<!--v-if-->
Expand Down
Loading

0 comments on commit 2604955

Please sign in to comment.