diff --git a/packages/web/src/pages/fb-share-page/FbSharePage.test.tsx b/packages/web/src/pages/fb-share-page/FbSharePage.test.tsx new file mode 100644 index 00000000000..f64dc442363 --- /dev/null +++ b/packages/web/src/pages/fb-share-page/FbSharePage.test.tsx @@ -0,0 +1,63 @@ +import type { ReactNode } from 'react' + +import { renderToStaticMarkup } from 'react-dom/server' +import { beforeEach, describe, expect, it, vi } from 'vitest' + +import { FbSharePage } from './FbSharePage' + +const account = vi.hoisted(() => ({ handle: undefined as string | undefined })) + +vi.mock('@audius/common/api', () => ({ + useCurrentAccountUser: () => ({ data: account.handle }) +})) + +vi.mock('@audius/common/utils', () => ({ + route: { SIGN_IN_PAGE: '/signin', PRIVACY_POLICY: '/legal/privacy-policy' } +})) + +vi.mock('@audius/harmony', () => ({ + Text: ({ children }: { children: ReactNode }) =>
{children}
, + Button: ({ children }: { children: ReactNode }) => <>{children}>, + IconFacebook: () => null +})) + +vi.mock('services/env', () => ({ + env: { + PUBLIC_HOSTNAME: 'audius.co', + FACEBOOK_APP_ID: '3438219622966374' + } +})) + +describe('Facebook profile sharing', () => { + beforeEach(() => { + account.handle = undefined + }) + + it('offers login and a public privacy policy before authentication', () => { + const html = renderToStaticMarkup(