fix(profile): restore source hints and upload-only avatar
This commit is contained in:
@@ -88,6 +88,8 @@ function createUser(overrides: Partial<User> = {}): User {
|
||||
async function flushAsyncWork(): Promise<void> {
|
||||
await Promise.resolve()
|
||||
await Promise.resolve()
|
||||
await Promise.resolve()
|
||||
await Promise.resolve()
|
||||
}
|
||||
|
||||
const originalFileReader = globalThis.FileReader
|
||||
@@ -156,6 +158,23 @@ describe('ProfileAvatarCard', () => {
|
||||
vi.restoreAllMocks()
|
||||
})
|
||||
|
||||
it('does not render a manual avatar input field', () => {
|
||||
authStoreState.user = createUser()
|
||||
|
||||
const wrapper = mount(ProfileAvatarCard, {
|
||||
props: {
|
||||
user: authStoreState.user
|
||||
},
|
||||
global: {
|
||||
stubs: {
|
||||
Icon: true
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
expect(wrapper.find('[data-testid="profile-avatar-input"]').exists()).toBe(false)
|
||||
})
|
||||
|
||||
it('compresses an uploaded image that exceeds the 20KB target before saving', async () => {
|
||||
installAvatarCompressionMocks()
|
||||
const updatedUser = createUser({ avatar_url: 'data:image/webp;base64,Y29tcHJlc3NlZC1hdmF0YXI=' })
|
||||
|
||||
Reference in New Issue
Block a user