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

42 lines
1.2 KiB
TypeScript
Raw Normal View History

2023-06-20 15:48:57 -07:00
import { fromJS } from 'immutable';
2023-01-15 10:48:10 -08:00
import alexJson from 'soapbox/__fixtures__/pleroma-account.json';
2023-06-20 15:48:57 -07:00
import { normalizeInstance } from 'soapbox/normalizers';
import { buildAccount } from './factory';
2023-01-15 10:48:10 -08:00
/** 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,
2023-06-20 15:48:57 -07:00
accounts: {
[alexJson.id]: buildAccount(alexJson as any),
},
2023-01-15 10:48:10 -08:00
};
export {
storeOpen,
storeClosed,
storePepeOpen,
storePepeClosed,
storeLoggedIn,
};