Skip to content

Commit

Permalink
make rollover validation test more comprehensive
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens committed Dec 9, 2020
1 parent 9293e1e commit 1f02f17
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ describe('edit policy', () => {
});
});
describe('hot phase', () => {
test('should show errors when trying to save with no max size and no max age', async () => {
test('should show errors when trying to save with no max size, no max age and no max docs', async () => {
const rendered = mountWithIntl(component);
expect(findTestSubject(rendered, 'rolloverSettingsRequired').exists()).toBeFalsy();
await setPolicyName(rendered, 'mypolicy');
Expand All @@ -338,6 +338,11 @@ describe('edit policy', () => {
maxAgeInput.simulate('change', { target: { value: '' } });
});
waitForFormLibValidation(rendered);
const maxDocsInput = findTestSubject(rendered, 'hot-selectedMaxDocuments');
await act(async () => {
maxDocsInput.simulate('change', { target: { value: '' } });
});
waitForFormLibValidation(rendered);
await save(rendered);
expect(findTestSubject(rendered, 'rolloverSettingsRequired').exists()).toBeTruthy();
});
Expand Down

0 comments on commit 1f02f17

Please sign in to comment.