Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonelizabeth committed Jan 7, 2021
1 parent 094970f commit 7ad2547
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { setAutoFreeze } from 'immer';
import { cloneDeep } from 'lodash';
import { SerializedPolicy } from '../../../../../common/types';
import { defaultRolloverAction } from '../../../constants';
import { deserializer } from './deserializer';
import { createSerializer } from './serializer';
import { FormInternal } from '../types';
Expand Down Expand Up @@ -268,6 +269,15 @@ describe('deserializer and serializer', () => {
expect(result.phases.warm!.min_age).toBeUndefined();
});

it('adds default rollover configuration when enabled, but previously not configured', () => {
delete formInternal.phases.hot!.actions.rollover;
formInternal._meta.hot.isUsingDefaultRollover = true;

const result = serializer(formInternal);

expect(result.phases.hot!.actions.rollover).toEqual(defaultRolloverAction);
});

it('removes snapshot_repository when it is unset', () => {
delete formInternal.phases.hot!.actions.searchable_snapshot;
delete formInternal.phases.cold!.actions.searchable_snapshot;
Expand Down

0 comments on commit 7ad2547

Please sign in to comment.