diff --git a/app/soapbox/features/landing_page/__tests__/landing_page.test.tsx b/app/soapbox/features/landing_page/__tests__/landing_page.test.tsx index 0b6396d5b..02b9a4fe0 100644 --- a/app/soapbox/features/landing_page/__tests__/landing_page.test.tsx +++ b/app/soapbox/features/landing_page/__tests__/landing_page.test.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import LandingPage from '..'; import { rememberInstance } from '../../../actions/instance'; +import { SOAPBOX_CONFIG_REMEMBER_SUCCESS } from '../../../actions/soapbox'; import { PEPE_FETCH_INSTANCE_SUCCESS } from '../../../actions/verification'; import { render, screen, rootReducer, applyActions } from '../../../jest/test-helpers'; @@ -40,13 +41,16 @@ describe('', () => { expect(screen.queryByTestId('registrations-pepe')).not.toBeInTheDocument(); }); - it('renders Pepe flow for an open Truth Social instance', () => { + it('renders Pepe flow if Pepe extension is enabled', () => { const state = applyActions(undefined, [{ - type: rememberInstance.fulfilled.type, - payload: { - version: '3.4.1 (compatible; TruthSocial 1.0.0)', - registrations: false, + type: SOAPBOX_CONFIG_REMEMBER_SUCCESS, + soapboxConfig: { + extensions: { + pepe: { + enabled: true, + }, + }, }, }, { type: PEPE_FETCH_INSTANCE_SUCCESS, diff --git a/app/soapbox/reducers/soapbox.js b/app/soapbox/reducers/soapbox.js index a208b4301..c8eeb7031 100644 --- a/app/soapbox/reducers/soapbox.js +++ b/app/soapbox/reducers/soapbox.js @@ -6,6 +6,7 @@ import { ConfigDB } from 'soapbox/utils/config_db'; import { ADMIN_CONFIG_UPDATE_SUCCESS } from '../actions/admin'; import { + SOAPBOX_CONFIG_REMEMBER_SUCCESS, SOAPBOX_CONFIG_REQUEST_SUCCESS, SOAPBOX_CONFIG_REQUEST_FAIL, } from '../actions/soapbox'; @@ -54,6 +55,8 @@ export default function soapbox(state = initialState, action) { switch(action.type) { case PLEROMA_PRELOAD_IMPORT: return preloadImport(state, action); + case SOAPBOX_CONFIG_REMEMBER_SUCCESS: + return fromJS(action.soapboxConfig); case SOAPBOX_CONFIG_REQUEST_SUCCESS: return importSoapboxConfig(state, fromJS(action.soapboxConfig), action.host); case SOAPBOX_CONFIG_REQUEST_FAIL: