fix(profile): stabilize binding compatibility and frontend checks
This commit is contained in:
@@ -336,6 +336,33 @@ describe('LinuxDoCallbackView', () => {
|
||||
)
|
||||
})
|
||||
|
||||
it('keeps rendering bind-login UI for legacy pending bind responses instead of treating them as success', async () => {
|
||||
exchangePendingOAuthCompletion.mockResolvedValue({
|
||||
error: 'adopt_existing_user_by_email',
|
||||
redirect: '/profile/security',
|
||||
email: 'existing@example.com'
|
||||
})
|
||||
|
||||
const wrapper = mount(LinuxDoCallbackView, {
|
||||
global: {
|
||||
stubs: {
|
||||
AuthLayout: { template: '<div><slot /></div>' },
|
||||
Icon: true,
|
||||
RouterLink: { template: '<a><slot /></a>' },
|
||||
transition: false
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
await flushPromises()
|
||||
|
||||
expect(showSuccess).not.toHaveBeenCalled()
|
||||
expect(replace).not.toHaveBeenCalled()
|
||||
expect((wrapper.get('[data-testid="linuxdo-bind-login-email"]').element as HTMLInputElement).value).toBe(
|
||||
'existing@example.com'
|
||||
)
|
||||
})
|
||||
|
||||
it('persists a pending auth session when the oauth flow still needs account creation', async () => {
|
||||
exchangePendingOAuthCompletion.mockResolvedValue({
|
||||
error: 'email_required',
|
||||
|
||||
Reference in New Issue
Block a user