Skip to content

Commit

Permalink
added test for not-on-cloud case
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens committed Oct 12, 2020
1 parent 38e6900 commit 56a4cee
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,29 @@ describe('edit policy', () => {
expectedErrorMessages(rendered, [positiveNumberRequiredMessage]);
});
});
describe('not on cloud', () => {
beforeEach(() => {
server.respondImmediately = true;
});
test('should show all allocation options, even if using legacy config', async () => {
http.setupNodeListResponse({
nodesByAttributes: { test: ['123'] },
nodesByRoles: { data: ['test'], data_hot: ['test'], data_warm: ['test'] },
isUsingLegacyDataRoleConfig: true,
});
const rendered = mountWithIntl(component);
noRollover(rendered);
setPolicyName(rendered, 'mypolicy');
await activatePhase(rendered, 'warm');
expect(rendered.find('.euiLoadingSpinner').exists()).toBeFalsy();

// Assert that only the custom and off options exist
findTestSubject(rendered, 'dataTierSelect').simulate('click');
expect(findTestSubject(rendered, 'defaultDataAllocationOption').exists()).toBeTruthy();
expect(findTestSubject(rendered, 'customDataAllocationOption').exists()).toBeTruthy();
expect(findTestSubject(rendered, 'noneDataAllocationOption').exists()).toBeTruthy();
});
});
describe('on cloud', () => {
beforeEach(() => {
component = (
Expand Down

0 comments on commit 56a4cee

Please sign in to comment.