{account && (
diff --git a/app/soapbox/features/ui/components/panels/__tests__/sign-up-panel.test.tsx b/app/soapbox/features/ui/components/panels/__tests__/sign-up-panel.test.tsx
new file mode 100644
index 000000000..003727ab7
--- /dev/null
+++ b/app/soapbox/features/ui/components/panels/__tests__/sign-up-panel.test.tsx
@@ -0,0 +1,35 @@
+import { fromJS } from 'immutable';
+import React from 'react';
+
+import { render, screen } from 'soapbox/jest/test-helpers';
+import { normalizeInstance } from 'soapbox/normalizers';
+
+import SignUpPanel from '../sign-up-panel';
+
+describe('', () => {
+ it('doesn\'t render by default', () => {
+ render();
+ expect(screen.queryByTestId('sign-up-panel')).not.toBeInTheDocument();
+ });
+
+ describe('with registrations enabled', () => {
+ it('successfully renders', () => {
+ const store = { instance: normalizeInstance({ registrations: true }) };
+ render(, undefined, store);
+ expect(screen.getByTestId('sign-up-panel')).toBeInTheDocument();
+ });
+ });
+
+ describe('with registrations closed, Pepe enabled', () => {
+ it('successfully renders', () => {
+ const store = {
+ instance: normalizeInstance({ registrations: false }),
+ soapbox: fromJS({ extensions: { pepe: { enabled: true } } }),
+ verification: { instance: fromJS({ registrations: true }) },
+ };
+
+ render(, undefined, store);
+ expect(screen.getByTestId('sign-up-panel')).toBeInTheDocument();
+ });
+ });
+});
diff --git a/app/soapbox/features/ui/components/panels/sign-up-panel.tsx b/app/soapbox/features/ui/components/panels/sign-up-panel.tsx
index 7df125591..f5e6c9222 100644
--- a/app/soapbox/features/ui/components/panels/sign-up-panel.tsx
+++ b/app/soapbox/features/ui/components/panels/sign-up-panel.tsx
@@ -12,7 +12,7 @@ const SignUpPanel = () => {
if (me || !isOpen) return null;
return (
-
+
diff --git a/app/soapbox/hooks/__tests__/useRegistrationStatus.test.ts b/app/soapbox/hooks/__tests__/useRegistrationStatus.test.ts
new file mode 100644
index 000000000..4dd9e42ce
--- /dev/null
+++ b/app/soapbox/hooks/__tests__/useRegistrationStatus.test.ts
@@ -0,0 +1,62 @@
+import { fromJS } from 'immutable';
+
+import { renderHook } from 'soapbox/jest/test-helpers';
+import { normalizeInstance } from 'soapbox/normalizers';
+
+import { useRegistrationStatus } from '../useRegistrationStatus';
+
+describe('useRegistrationStatus()', () => {
+ test('Registrations open', () => {
+ const store = { instance: normalizeInstance({ registrations: true }) };
+ const { result } = renderHook(useRegistrationStatus, undefined, store);
+
+ expect(result.current).toMatchObject({
+ isOpen: true,
+ pepeEnabled: false,
+ pepeOpen: false,
+ });
+ });
+
+ test('Registrations closed', () => {
+ const store = { instance: normalizeInstance({ registrations: false }) };
+ const { result } = renderHook(useRegistrationStatus, undefined, store);
+
+ expect(result.current).toMatchObject({
+ isOpen: false,
+ pepeEnabled: false,
+ pepeOpen: false,
+ });
+ });
+
+ test('Registrations closed, Pepe enabled & open', () => {
+ const store = {
+ instance: normalizeInstance({ registrations: false }),
+ soapbox: fromJS({ extensions: { pepe: { enabled: true } } }),
+ verification: { instance: fromJS({ registrations: true }) },
+ };
+
+ const { result } = renderHook(useRegistrationStatus, undefined, store);
+
+ expect(result.current).toMatchObject({
+ isOpen: true,
+ pepeEnabled: true,
+ pepeOpen: true,
+ });
+ });
+
+ test('Registrations closed, Pepe enabled & closed', () => {
+ const store = {
+ instance: normalizeInstance({ registrations: false }),
+ soapbox: fromJS({ extensions: { pepe: { enabled: true } } }),
+ verification: { instance: fromJS({ registrations: false }) },
+ };
+
+ const { result } = renderHook(useRegistrationStatus, undefined, store);
+
+ expect(result.current).toMatchObject({
+ isOpen: false,
+ pepeEnabled: true,
+ pepeOpen: false,
+ });
+ });
+});