diff --git a/packages/extension/src/newtab/HijackingLoginStrip.spec.tsx b/packages/extension/src/newtab/HijackingLoginStrip.spec.tsx index 087c8a528b..0db8b2d666 100644 --- a/packages/extension/src/newtab/HijackingLoginStrip.spec.tsx +++ b/packages/extension/src/newtab/HijackingLoginStrip.spec.tsx @@ -1,8 +1,14 @@ import React from 'react'; import { fireEvent, render, screen } from '@testing-library/react'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import type { AuthContextData } from '@dailydotdev/shared/src/contexts/AuthContext'; import { useAuthContext } from '@dailydotdev/shared/src/contexts/AuthContext'; import { getLogContextStatic } from '@dailydotdev/shared/src/contexts/LogContext'; +import { useSignBack } from '@dailydotdev/shared/src/hooks/auth/useSignBack'; +import { + AuthDisplay, + SocialProvider, +} from '@dailydotdev/shared/src/components/auth/common'; import { AuthTriggers } from '@dailydotdev/shared/src/lib/auth'; import { onboardingUrl } from '@dailydotdev/shared/src/lib/constants'; import { LogEvent, TargetType } from '@dailydotdev/shared/src/lib/log'; @@ -14,10 +20,54 @@ jest.mock('@dailydotdev/shared/src/contexts/AuthContext', () => ({ useAuthContext: jest.fn(), })); +jest.mock('@dailydotdev/shared/src/hooks/auth/useSignBack', () => ({ + useSignBack: jest.fn(), +})); + +jest.mock('@dailydotdev/shared/src/components/auth/AuthOptions', () => { + const { AuthDisplay: MockAuthDisplay } = jest.requireActual( + '@dailydotdev/shared/src/components/auth/common', + ); + + return { + __esModule: true, + default: ({ + onAuthStateUpdate, + }: { + onAuthStateUpdate?: (props: { defaultDisplay?: string }) => void; + }) => ( +
By continuing, you agree to the Terms of Service
++ Sign in and daily.dev will remember the topics, saves, upvotes, + and discussions that matter to you. +
++ Sign in to turn daily.dev into your personalized feed, reputation, + saves, and community in every new tab. +
+- {isLoggedOut - ? 'Log in to pick up where you left off.' - : 'You still have a few onboarding steps left. Finish them to unlock the full experience.'} -
- {isLoggedOut ? ( - - ) : ( - - )} -+ Finish onboarding to unlock the full daily.dev experience. +
+ +{signBack.email}
+ )} + +