test: update avatar snap

refactor-list
tangjinzhou 2021-06-21 14:35:44 +08:00
parent 276e4ec250
commit 4a0b04e063
2 changed files with 4 additions and 26 deletions

View File

@ -138,7 +138,7 @@ describe('Avatar Render', () => {
});
await asyncExpect(() => {
expect(wrapper.find('.ant-avatar-string')).toMatchSnapshot();
expect(wrapper.find('.ant-avatar-string').html()).toMatchSnapshot();
}, 0);
Object.defineProperty(HTMLElement.prototype, 'offsetWidth', {
@ -155,7 +155,7 @@ describe('Avatar Render', () => {
},
});
await asyncExpect(() => {
expect(wrapper.find('.ant-avatar-string')).toMatchSnapshot();
expect(wrapper.find('.ant-avatar-string').html()).toMatchSnapshot();
}, 0);
});

View File

@ -14,30 +14,8 @@ exports[`Avatar Render adjusts component size to 100 when window size is xxl 1`]
exports[`Avatar Render fallback 1`] = `<span class="ant-avatar ant-avatar-circle ant-avatar-image"><img draggable="false" src="http://error.url"></span>`;
exports[`Avatar Render should calculate scale of avatar children correctly 1`] = `
DOMWrapper {
"wrapperElement": <span
class="ant-avatar-string"
style="transform: scale(0.72) translateX(-50%);"
>
Avatar
</span>,
}
`;
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>`;
exports[`Avatar Render should calculate scale of avatar children correctly 2`] = `
DOMWrapper {
"wrapperElement": <span
class="ant-avatar-string"
style="transform: scale(0.32) translateX(-50%);"
>
xx
</span>,
}
`;
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>`;
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>`;