Skip to content

Commit

Permalink
update test coverage to be consistent with new form behaviour and exp…
Browse files Browse the repository at this point in the history
…and hot phase without rollover test
  • Loading branch information
jloleysens committed Feb 25, 2021
1 parent 4f5f554 commit 0b48847
Showing 1 changed file with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ describe('<EditPolicy />', () => {
await actions.cold.setMinAgeUnits('s');
await actions.cold.setDataAllocation('node_attrs');
await actions.cold.setSelectedNodeAttribute('test:123');
await actions.cold.setSearchableSnapshot('my-repo');
await actions.cold.setReplicas('123');
await actions.cold.setFreeze(true);
await actions.cold.setIndexPriority('123');
Expand All @@ -426,6 +427,9 @@ describe('<EditPolicy />', () => {
},
},
"freeze": Object {},
"searchable_snapshot": Object {
"snapshot_repository": "my-repo",
},
"set_priority": Object {
"priority": 123,
},
Expand All @@ -445,19 +449,6 @@ describe('<EditPolicy />', () => {
}
`);
});

// Setting searchable snapshot field disables setting replicas so we test this separately
test('setting searchable snapshot', async () => {
const { actions } = testBed;
await actions.cold.enable(true);
await actions.cold.setSearchableSnapshot('my-repo');
await actions.savePolicy();
const latestRequest2 = server.requests[server.requests.length - 1];
const entirePolicy2 = JSON.parse(JSON.parse(latestRequest2.requestBody).body);
expect(entirePolicy2.phases.cold.actions.searchable_snapshot.snapshot_repository).toEqual(
'my-repo'
);
});
});
});

Expand Down Expand Up @@ -844,13 +835,15 @@ describe('<EditPolicy />', () => {
const { component } = testBed;
component.update();
});
test('hiding and disabling searchable snapshot field', async () => {
test('hides fields in hot phase', async () => {
const { actions } = testBed;
await actions.hot.toggleDefaultRollover(false);
await actions.hot.toggleRollover(false);
await actions.cold.enable(true);

expect(actions.hot.forceMergeFieldExists()).toBeFalsy();
expect(actions.hot.shrinkExists()).toBeFalsy();
expect(actions.hot.searchableSnapshotsExists()).toBeFalsy();
expect(actions.hot.readonlyExists()).toBeFalsy();
});

test('hiding rollover tip on minimum age', async () => {
Expand Down

0 comments on commit 0b48847

Please sign in to comment.