diff --git a/apps/web/src/app/get-started/personal/_components/ProductOptionsContent.tsx b/apps/web/src/app/get-started/personal/_components/ProductOptionsContent.tsx index 50b88b1977..dca5590043 100644 --- a/apps/web/src/app/get-started/personal/_components/ProductOptionsContent.tsx +++ b/apps/web/src/app/get-started/personal/_components/ProductOptionsContent.tsx @@ -221,20 +221,31 @@ export default function WelcomeContent({ isAuthenticated }: WelcomeContentProps) /> - {!isAuthenticated ? ( -

+ Not ready to choose?{' '} + - Already have an account?{' '} - - Sign in - -

- ) : null} + Skip to dashboard + + + {!isAuthenticated ? ( + <> + ยท + Already have an account?{' '} + + Sign in + + + ) : null} +

); diff --git a/apps/web/tests/e2e/get-started-dashboard-link.spec.ts b/apps/web/tests/e2e/get-started-dashboard-link.spec.ts new file mode 100644 index 0000000000..d7f61cfc00 --- /dev/null +++ b/apps/web/tests/e2e/get-started-dashboard-link.spec.ts @@ -0,0 +1,41 @@ +import { test, expect } from '@chromatic-com/playwright'; +import { randomUUID } from 'crypto'; + +test.describe('/get-started dashboard escape hatch', () => { + test.use({ storageState: { cookies: [], origins: [] } }); + + test('shows the dashboard link to signed-out users', async ({ page }) => { + await page.goto('/get-started'); + + const skipLink = page.getByRole('link', { name: /skip to dashboard/i }); + await expect(skipLink).toBeVisible(); + await expect(skipLink).toHaveAttribute('href', '/profile'); + }); + + test('shows the dashboard link after fake login and survey skip', async ({ page }) => { + const uniqueId = randomUUID().slice(0, 8); + const testEmail = `test-get-started-${uniqueId}+stytchpass@example.com`; + + await page.goto(`/users/sign_in?fakeUser=${encodeURIComponent(testEmail)}`); + await page.waitForURL( + url => + url.pathname === '/customer-source-survey' || + url.pathname === '/get-started' || + url.pathname === '/profile', + { timeout: 30000, waitUntil: 'networkidle' } + ); + + if (new URL(page.url()).pathname === '/customer-source-survey') { + await page.getByRole('button', { name: 'Skip' }).click(); + await page.waitForURL(url => url.pathname === '/get-started' || url.pathname === '/profile', { + timeout: 15000, + waitUntil: 'networkidle', + }); + } + + await page.goto('/get-started'); + const skipLink = page.getByRole('link', { name: /skip to dashboard/i }); + await expect(skipLink).toBeVisible(); + await expect(skipLink).toHaveAttribute('href', '/profile'); + }); +});