pleroma/packages/pl-fe/src/reducers/meta.test.ts

22 lines
655 B
TypeScript
Raw Normal View History

import { Record as ImmutableRecord } from 'immutable';
import { SW_UPDATING, setSwUpdating } from 'pl-fe/actions/sw';
import reducer from './meta';
2020-06-09 18:08:07 -07:00
describe('meta reducer', () => {
it('should return the initial state', () => {
2022-07-06 09:53:55 -07:00
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);
});
2020-06-09 18:08:07 -07:00
});
});