diff --git a/app/soapbox/features/public-layout/components/__tests__/header.test.tsx b/app/soapbox/features/public-layout/components/__tests__/header.test.tsx new file mode 100644 index 000000000..d69198efa --- /dev/null +++ b/app/soapbox/features/public-layout/components/__tests__/header.test.tsx @@ -0,0 +1,32 @@ +import React from 'react'; + +import { storeOpen, storePepeOpen } from 'soapbox/jest/mock-stores'; +import { render, screen } from 'soapbox/jest/test-helpers'; + +import Header from '../header'; + +describe('
', () => { + it('successfully renders', () => { + render(
); + expect(screen.getByTestId('public-layout-header')).toBeInTheDocument(); + }); + + it('doesn\'t display the signup button by default', () => { + render(
); + expect(screen.queryByText('Register')).not.toBeInTheDocument(); + }); + + describe('with registrations enabled', () => { + it('displays the signup button', () => { + render(
, undefined, storeOpen); + expect(screen.getByText('Register')).toBeInTheDocument(); + }); + }); + + describe('with registrations closed, Pepe enabled', () => { + it('displays the signup button', () => { + render(
, undefined, storePepeOpen); + expect(screen.getByText('Register')).toBeInTheDocument(); + }); + }); +}); \ No newline at end of file diff --git a/app/soapbox/features/public-layout/components/header.tsx b/app/soapbox/features/public-layout/components/header.tsx index ad3accc83..e771fe5cd 100644 --- a/app/soapbox/features/public-layout/components/header.tsx +++ b/app/soapbox/features/public-layout/components/header.tsx @@ -65,7 +65,7 @@ const Header = () => { if (mfaToken) return ; return ( -
+