fix profile activity and migration remediation

This commit is contained in:
IanShaw027
2026-04-21 02:08:56 +08:00
parent a27a7add3d
commit ebe7524415
12 changed files with 703 additions and 28 deletions

View File

@@ -62,6 +62,8 @@ vi.mock('vue-i18n', async (importOriginal) => {
if (key === 'profile.authBindings.providers.linuxdo') return 'LinuxDo'
if (key === 'profile.authBindings.providers.wechat') return 'WeChat'
if (key === 'profile.authBindings.providers.oidc') return params?.providerName || 'OIDC'
if (key === 'profile.authBindings.source.avatar') return `Avatar synced from ${params?.providerName || 'provider'}`
if (key === 'profile.authBindings.source.username') return `Username synced from ${params?.providerName || 'provider'}`
if (key === 'common.save') return 'Save'
if (key === 'common.delete') return 'Delete'
return key
@@ -169,4 +171,29 @@ describe('ProfileInfoCard', () => {
expect(authStoreState.user?.avatar_url).toBeNull()
expect(showSuccessMock).toHaveBeenCalledWith('Avatar removed')
})
it('renders third-party source hints from profile_sources', () => {
authStoreState.user = createUser({
avatar_url: 'https://cdn.example.com/linuxdo.png',
profile_sources: {
avatar: { provider: 'linuxdo', source: 'linuxdo' },
username: { provider: 'linuxdo', source: 'linuxdo' }
}
})
const wrapper = mount(ProfileInfoCard, {
props: {
user: authStoreState.user
},
global: {
stubs: {
Icon: true,
ProfileIdentityBindingsSection: true
}
}
})
expect(wrapper.text()).toContain('Avatar synced from LinuxDo')
expect(wrapper.text()).toContain('Username synced from LinuxDo')
})
})