pleroma/packages/pl-fe/src/reducers/meta.test.ts
marcin mikołajczak 966b04fdf0 Call it pl-fe internally
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-08-28 13:41:08 +02:00

21 lines
655 B
TypeScript

import { Record as ImmutableRecord } from 'immutable';
import { SW_UPDATING, setSwUpdating } from 'pl-fe/actions/sw';
import reducer from './meta';
describe('meta reducer', () => {
it('should return the initial state', () => {
const result = reducer(undefined, {} as any);
expect(ImmutableRecord.isRecord(result)).toBe(true);
expect(result.instance_fetch_failed).toBe(false);
expect(result.swUpdating).toBe(false);
});
describe(SW_UPDATING, () => {
it('sets swUpdating to the provided value', () => {
const result = reducer(undefined, setSwUpdating(true));
expect(result.swUpdating).toBe(true);
});
});
});