soapbox/src/jest/mock-stores.tsx

24 wiersze
610 B
TypeScript

2023-01-15 18:48:10 +00:00
import alexJson from 'soapbox/__fixtures__/pleroma-account.json';
2023-06-20 22:48:57 +00:00
import { normalizeInstance } from 'soapbox/normalizers';
import { buildAccount } from './factory';
2023-01-15 18:48:10 +00:00
/** Store with registrations open. */
const storeOpen = { instance: normalizeInstance({ registrations: true }) };
/** Store with registrations closed. */
const storeClosed = { instance: normalizeInstance({ registrations: false }) };
/** Store with a logged-in user. */
const storeLoggedIn = {
me: alexJson.id,
2023-06-20 22:48:57 +00:00
accounts: {
[alexJson.id]: buildAccount(alexJson as any),
},
2023-01-15 18:48:10 +00:00
};
export {
storeOpen,
storeClosed,
storeLoggedIn,
};