2022-03-11 12:42:52 -08:00
|
|
|
import { Record as ImmutableRecord } from 'immutable';
|
2022-01-10 14:25:06 -08:00
|
|
|
|
2024-08-28 04:41:08 -07:00
|
|
|
import { SW_UPDATING, setSwUpdating } from 'pl-fe/actions/sw';
|
2022-06-24 09:52:57 -07:00
|
|
|
|
2023-10-02 12:27:40 -07:00
|
|
|
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);
|
2022-03-11 12:42:52 -08:00
|
|
|
expect(ImmutableRecord.isRecord(result)).toBe(true);
|
|
|
|
expect(result.instance_fetch_failed).toBe(false);
|
2022-06-24 09:52:57 -07:00
|
|
|
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
|
|
|
});
|
|
|
|
});
|