Merge pull request #7501 from ouchihao/codex/bug-profile-dingtalk-source

fix(profile): recognize DingTalk profile sources
This commit is contained in:
Wesley Liddick authored and GitHub committed 2026-09-23 09:57:39 +08:00
commit a81547f244
2 files changed
+15

No files matched your search

@@ -281,6 +281,7 @@ function normalizeProvider(value: string): UserAuthProvider | null {
if (
normalized === 'email' ||
normalized === 'linuxdo' ||
normalized === 'dingtalk' ||
normalized === 'wechat' ||
normalized === 'github' ||
normalized === 'google'
@@ -35,6 +35,7 @@ vi.mock('vue-i18n', async (importOriginal) => {
if (key === 'profile.user') return 'User'
if (key === 'profile.authBindings.providers.email') return 'Email'
if (key === 'profile.authBindings.providers.linuxdo') return 'LinuxDo'
if (key === 'profile.authBindings.providers.dingtalk') return 'DingTalk'
if (key === 'profile.authBindings.providers.wechat') return 'WeChat'
if (key === 'profile.authBindings.providers.oidc') return params?.providerName || 'OIDC'
if (key === 'profile.authBindings.source.avatar') {
@@ -70,6 +71,19 @@ function createUser(overrides: Partial<User> = {}): User {
}
describe('ProfileInfoCard', () => {
it.each([
{ avatar_source: 'dingtalk', username_source: 'dingtalk' },
{ profile_sources: { avatar: { provider: 'dingtalk' }, username: { provider: 'dingtalk' } } },
])('shows DingTalk as the synchronized profile source', (sources) => {
const wrapper = mount(ProfileInfoCard, {
props: { user: createUser(sources), dingtalkEnabled: true },
global: { stubs: { Icon: true } },
})
expect(wrapper.text()).toContain('Avatar synced from DingTalk')
expect(wrapper.text()).toContain('Username synced from DingTalk')
wrapper.unmount()
})
it('renders basic account information inside the new overview shell', () => {
const wrapper = mount(ProfileInfoCard, {
props: {