bigbuffet-rw/app/soapbox/jest/mock-stores.tsx

40 lines
1.2 KiB
TypeScript
Raw Normal View History

2023-01-15 10:48:10 -08:00
import { Map as ImmutableMap, fromJS } from 'immutable';
import alexJson from 'soapbox/__fixtures__/pleroma-account.json';
import { normalizeAccount, normalizeInstance } from 'soapbox/normalizers';
/** Store with registrations open. */
const storeOpen = { instance: normalizeInstance({ registrations: true }) };
/** Store with registrations closed. */
const storeClosed = { instance: normalizeInstance({ registrations: false }) };
/** Store with registrations closed, and Pepe enabled & open. */
const storePepeOpen = {
instance: normalizeInstance({ registrations: false }),
soapbox: fromJS({ extensions: { pepe: { enabled: true } } }),
verification: { instance: fromJS({ registrations: true }) },
};
/** Store with registrations closed, and Pepe enabled & closed. */
const storePepeClosed = {
instance: normalizeInstance({ registrations: false }),
soapbox: fromJS({ extensions: { pepe: { enabled: true } } }),
verification: { instance: fromJS({ registrations: false }) },
};
/** Store with a logged-in user. */
const storeLoggedIn = {
me: alexJson.id,
accounts: ImmutableMap({
[alexJson.id]: normalizeAccount(alexJson),
}),
};
export {
storeOpen,
storeClosed,
storePepeOpen,
storePepeClosed,
storeLoggedIn,
};