feat(FN-1899): add login timeout, cancellation, and 409 conflict handling
- Add LoginOutcome type ('pending' | 'success' | 'failed' | 'timeout') with state tracking
- Implement AbortController-based cancellation for OAuth login flows
- Add timeout detection after MAX_POLL_CYCLES (150 polls, ~5 min)
- Handle 409 Conflict when concurrent login is attempted
- Persist login outcomes to onboarding stepData for session recovery
- Add getStepData mock export to App.test.tsx vi.mock
- Fix ToastType: use 'info' instead of invalid 'warning' type
This commit is contained in:
@@ -1321,7 +1321,7 @@ describe("ModelOnboardingModal", () => {
|
||||
await waitFor(() => {
|
||||
expect(addToast).toHaveBeenCalledWith(
|
||||
"Login already in progress. Please wait or cancel the current attempt.",
|
||||
"warning"
|
||||
"info"
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -1517,7 +1517,7 @@ describe("ModelOnboardingModal", () => {
|
||||
});
|
||||
|
||||
// Should show timeout toast
|
||||
expect(addToast).toHaveBeenCalledWith("Login timed out. Please try again.", "warning");
|
||||
expect(addToast).toHaveBeenCalledWith("Login timed out. Please try again.", "info");
|
||||
|
||||
// Cancel button should not be shown after timeout
|
||||
expect(screen.queryByText("Cancel")).toBeNull();
|
||||
|
||||
Reference in New Issue
Block a user