Skip to content

Commit 4a0b04e

Browse files
committed
test: update avatar snap
1 parent 276e4ec commit 4a0b04e

File tree

2 files changed

+5
-27
lines changed

2 files changed

+5
-27
lines changed

components/avatar/__tests__/Avatar.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ describe('Avatar Render', () => {
138138
});
139139

140140
await asyncExpect(() => {
141-
expect(wrapper.find('.ant-avatar-string')).toMatchSnapshot();
141+
expect(wrapper.find('.ant-avatar-string').html()).toMatchSnapshot();
142142
}, 0);
143143

144144
Object.defineProperty(HTMLElement.prototype, 'offsetWidth', {
@@ -155,7 +155,7 @@ describe('Avatar Render', () => {
155155
},
156156
});
157157
await asyncExpect(() => {
158-
expect(wrapper.find('.ant-avatar-string')).toMatchSnapshot();
158+
expect(wrapper.find('.ant-avatar-string').html()).toMatchSnapshot();
159159
}, 0);
160160
});
161161

components/avatar/__tests__/__snapshots__/Avatar.test.js.snap

+3-25
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,8 @@ exports[`Avatar Render adjusts component size to 100 when window size is xxl 1`]
1414

1515
exports[`Avatar Render fallback 1`] = `<span class="ant-avatar ant-avatar-circle ant-avatar-image"><img draggable="false" src="http://error.url"></span>`;
1616
17-
exports[`Avatar Render should calculate scale of avatar children correctly 1`] = `
18-
DOMWrapper {
19-
"wrapperElement": <span
20-
class="ant-avatar-string"
21-
style="transform: scale(0.72) translateX(-50%);"
22-
>
23-
24-
Avatar
25-
26-
</span>,
27-
}
28-
`;
29-
30-
exports[`Avatar Render should calculate scale of avatar children correctly 2`] = `
31-
DOMWrapper {
32-
"wrapperElement": <span
33-
class="ant-avatar-string"
34-
style="transform: scale(0.32) translateX(-50%);"
35-
>
36-
37-
xx
38-
39-
</span>,
40-
}
41-
`;
17+
exports[`Avatar Render should calculate scale of avatar children correctly 1`] = `<span class="ant-avatar-string" style="transform: scale(0.72) translateX(-50%);">Avatar</span>`;
18+
19+
exports[`Avatar Render should calculate scale of avatar children correctly 2`] = `<span class="ant-avatar-string" style="transform: scale(0.32) translateX(-50%);">xx</span>`;
4220
4321
exports[`Avatar Render should calculate scale of avatar children correctly with gap 1`] = `<span class="ant-avatar ant-avatar-circle"><span class="ant-avatar-string" style="transform: scale(0.36) translateX(-50%);">Avatar</span></span>`;

0 commit comments

Comments
 (0)