fix(onboarding): prevent no-auth auto settings modal races
This commit is contained in:
parent
c5b39f5312
commit
c6047ffaa4
3 changed files with 9 additions and 10 deletions
|
|
@ -179,7 +179,11 @@ export function OnboardingFlowProvider({ children }: { children: ReactNode }) {
|
||||||
|
|
||||||
if (!local.firstVisitSettingsOpened) {
|
if (!local.firstVisitSettingsOpened) {
|
||||||
await setFirstVisit(true);
|
await setFirstVisit(true);
|
||||||
openSettingsNow();
|
// In no-auth mode (used by local/CI e2e), avoid background modal opens
|
||||||
|
// that can race with interactions and steal pointer events.
|
||||||
|
if (authEnabled) {
|
||||||
|
openSettingsNow();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -263,6 +267,10 @@ export function OnboardingFlowProvider({ children }: { children: ReactNode }) {
|
||||||
}, [advanceFlow, authEnabled]);
|
}, [advanceFlow, authEnabled]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (!authEnabled) {
|
||||||
|
return () => { };
|
||||||
|
}
|
||||||
|
|
||||||
return scheduleChangelogCheck({
|
return scheduleChangelogCheck({
|
||||||
authEnabled,
|
authEnabled,
|
||||||
isSessionPending,
|
isSessionPending,
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import {
|
||||||
dispatchHtml5DragAndDrop,
|
dispatchHtml5DragAndDrop,
|
||||||
expectDocumentListed,
|
expectDocumentListed,
|
||||||
expectNoDocumentLink,
|
expectNoDocumentLink,
|
||||||
dismissBlockingModals,
|
|
||||||
} from './helpers';
|
} from './helpers';
|
||||||
|
|
||||||
test.describe('Document folders and hint persistence', () => {
|
test.describe('Document folders and hint persistence', () => {
|
||||||
|
|
@ -63,7 +62,6 @@ test.describe('Document folders and hint persistence', () => {
|
||||||
// Reload and verify persisted folder + membership
|
// Reload and verify persisted folder + membership
|
||||||
await page.reload();
|
await page.reload();
|
||||||
await page.waitForLoadState('networkidle');
|
await page.waitForLoadState('networkidle');
|
||||||
await dismissBlockingModals(page);
|
|
||||||
const myFolderRowAfter = folderRow(page, 'My Folder');
|
const myFolderRowAfter = folderRow(page, 'My Folder');
|
||||||
await expect(myFolderRowAfter).toBeVisible();
|
await expect(myFolderRowAfter).toBeVisible();
|
||||||
await myFolderRowAfter.click();
|
await myFolderRowAfter.click();
|
||||||
|
|
|
||||||
|
|
@ -177,13 +177,6 @@ async function dismissOnboardingModals(page: Page): Promise<void> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Dismiss startup/settings overlays that can intermittently appear after reloads.
|
|
||||||
*/
|
|
||||||
export async function dismissBlockingModals(page: Page): Promise<void> {
|
|
||||||
await dismissOnboardingModals(page);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wait for the play button to be clickable and click it
|
* Wait for the play button to be clickable and click it
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue