diff --git a/packages/frontend/editor-ui/src/init.test.ts b/packages/frontend/editor-ui/src/init.test.ts index cf19396495..09b7687373 100644 --- a/packages/frontend/editor-ui/src/init.test.ts +++ b/packages/frontend/editor-ui/src/init.test.ts @@ -280,6 +280,22 @@ describe('Init', () => { expect(cloudStoreSpy).toHaveBeenCalled(); expect(uiStore.pushBannerToStack).toHaveBeenCalledWith('EMAIL_CONFIRMATION'); }); + + it('should not push EMAIL_CONFIRMATION banner if user cloud account does not exist', async () => { + settingsStore.settings.deployment.type = 'cloud'; + usersStore.usersById = { '123': { id: '123', email: '' } as IUser }; + usersStore.currentUserId = '123'; + + cloudPlanStore.userIsTrialing = false; + cloudPlanStore.currentUserCloudInfo = null; + + const cloudStoreSpy = vi.spyOn(cloudPlanStore, 'initialize').mockResolvedValueOnce(); + + await initializeAuthenticatedFeatures(false); + + expect(cloudStoreSpy).toHaveBeenCalled(); + expect(uiStore.pushBannerToStack).not.toHaveBeenCalledWith('EMAIL_CONFIRMATION'); + }); }); }); }); diff --git a/packages/frontend/editor-ui/src/init.ts b/packages/frontend/editor-ui/src/init.ts index 27290316e4..812559d50b 100644 --- a/packages/frontend/editor-ui/src/init.ts +++ b/packages/frontend/editor-ui/src/init.ts @@ -157,7 +157,7 @@ export async function initializeAuthenticatedFeatures( } else { uiStore.pushBannerToStack('TRIAL'); } - } else if (!cloudPlanStore.currentUserCloudInfo?.confirmed) { + } else if (cloudPlanStore.currentUserCloudInfo?.confirmed === false) { uiStore.pushBannerToStack('EMAIL_CONFIRMATION'); } } catch (e) {