Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] Upgarde enzyme to v3.10.0 (#38766) #39088

Merged
merged 1 commit into from
Jun 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,9 @@
"classnames": "2.2.6",
"dedent": "^0.7.0",
"delete-empty": "^2.0.0",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.13.1",
"enzyme-adapter-utils": "^1.10.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
"enzyme-adapter-utils": "^1.12.0",
"enzyme-to-json": "^3.3.4",
"eslint": "5.16.0",
"eslint-config-prettier": "4.3.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,7 @@ test('field name change', async () => {
// ensure that after async loading is complete the DynamicOptionsSwitch is disabled, because this is not a "string" field
expect(component.find('[data-test-subj="listControlDynamicOptionsSwitch"][disabled=true]')).toHaveLength(0);
await update();


/*
The issue with enzyme@3.9.0 -> the fix has not been released yet -> https://github.com/airbnb/enzyme/pull/2027
TODO: Enable the expectation after the next patch released
expect(component.find('[data-test-subj="listControlDynamicOptionsSwitch"][disabled=true]')).toHaveLength(1);
*/

component.setProps({
controlParams
Expand Down
6 changes: 3 additions & 3 deletions x-pack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@
"copy-webpack-plugin": "^5.0.0",
"del": "^4.0.0",
"dotenv": "2.0.0",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.13.1",
"enzyme-adapter-utils": "^1.10.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
"enzyme-adapter-utils": "^1.12.0",
"enzyme-to-json": "^3.3.4",
"execa": "^1.0.0",
"fancy-log": "^1.3.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ describe('ilm summary extension', () => {
test('should render null when index has no index lifecycle policy', () => {
const extension = ilmSummaryExtension(indexWithoutLifecyclePolicy);
const rendered = mountWithIntl(extension);
expect(rendered.html()).toBeNull();
expect(rendered.isEmptyRender()).toBeTruthy();
});
test('should return extension when index has lifecycle policy', () => {
const extension = ilmSummaryExtension(indexWithLifecyclePolicy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ describe('RequestTrialExtension component', () => {
},
RequestTrialExtension
);
const html = rendered.html();
expect(html).toBeNull();
expect(rendered.isEmptyRender()).toBeTruthy();
});
test('should display when license is active and trial has been used', () => {
const rendered = getComponent(
Expand All @@ -46,8 +45,7 @@ describe('RequestTrialExtension component', () => {
},
RequestTrialExtension
);
const html = rendered.html();
expect(html).toBeNull();
expect(rendered.isEmptyRender()).toBeTruthy();
});
test('should display when license is not active and trial has been used', () => {
const rendered = getComponent(
Expand Down Expand Up @@ -87,7 +85,6 @@ describe('RequestTrialExtension component', () => {
},
RequestTrialExtension
);
const html = rendered.html();
expect(html).toBeNull();
expect(rendered.isEmptyRender()).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('RevertToBasic component', () => {
},
RevertToBasic
);
expect(rendered.html()).toBeNull();
expect(rendered.isEmptyRender()).toBeTruthy();
});
test('should not display for active gold license', () => {
const rendered = getComponent(
Expand All @@ -54,7 +54,7 @@ describe('RevertToBasic component', () => {
},
RevertToBasic
);
expect(rendered.html()).toBeNull();
expect(rendered.isEmptyRender()).toBeTruthy();
});
test('should not display for active platinum license', () => {
const rendered = getComponent(
Expand All @@ -63,6 +63,6 @@ describe('RevertToBasic component', () => {
},
RevertToBasic
);
expect(rendered.html()).toBeNull();
expect(rendered.isEmptyRender()).toBeTruthy();
});
});
12 changes: 6 additions & 6 deletions x-pack/plugins/license_management/__jest__/start_trial.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('StartTrial component when trial is allowed', () => {
},
StartTrial
);
expect(rendered.html()).toBeNull();
expect(rendered.isEmptyRender()).toBeTruthy();
});
test('should not display for active platinum license', () => {
const rendered = getComponent(
Expand All @@ -48,7 +48,7 @@ describe('StartTrial component when trial is allowed', () => {
},
StartTrial
);
expect(rendered.html()).toBeNull();
expect(rendered.isEmptyRender()).toBeTruthy();
});
test('should display for expired platinum license', () => {
const rendered = getComponent(
Expand All @@ -71,7 +71,7 @@ describe('StartTrial component when trial is not available', () => {
},
StartTrial
);
expect(rendered.html()).toBeNull();
expect(rendered.isEmptyRender()).toBeTruthy();
});
test('should not display for gold license', () => {
const rendered = getComponent(
Expand All @@ -81,7 +81,7 @@ describe('StartTrial component when trial is not available', () => {
},
StartTrial
);
expect(rendered.html()).toBeNull();
expect(rendered.isEmptyRender()).toBeTruthy();
});
test('should not display for platinum license', () => {
const rendered = getComponent(
Expand All @@ -91,7 +91,7 @@ describe('StartTrial component when trial is not available', () => {
},
StartTrial
);
expect(rendered.html()).toBeNull();
expect(rendered.isEmptyRender()).toBeTruthy();
});

test('should not display for trial license', () => {
Expand All @@ -102,6 +102,6 @@ describe('StartTrial component when trial is not available', () => {
},
StartTrial
);
expect(rendered.html()).toBeNull();
expect(rendered.isEmptyRender()).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ describe('Suggestions', () => {
test('is null when show is false', () => {
const noShowProps = { ...defaultProps, show: false };
const wrapper = shallow(<Suggestions {...noShowProps} />);
expect(wrapper.html()).toBeNull();
expect(wrapper.isEmptyRender()).toBeTruthy();
});

test('is null when no suggestions are available', () => {
const noSuggestions = { ...defaultProps, suggestions: [] };
const wrapper = shallow(<Suggestions {...noSuggestions} />);
expect(wrapper.html()).toBeNull();
expect(wrapper.isEmptyRender()).toBeTruthy();
});

test('creates suggestion list item for each suggestion passed in via props', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe('draggables', () => {
<DefaultDraggable id="draggable-id" field="some-field" value={undefined} />
</TestProviders>
);
expect(wrapper.text()).toBeNull();
expect(wrapper.isEmptyRender()).toBeTruthy();
});

test('it returns null if value is null', () => {
Expand All @@ -122,7 +122,7 @@ describe('draggables', () => {
<DefaultDraggable id="draggable-id" field="some-field" value={null} />
</TestProviders>
);
expect(wrapper.text()).toBeNull();
expect(wrapper.isEmptyRender()).toBeTruthy();
});

test('it renders a tooltip with the field name if a tooltip is not explicitly provided', () => {
Expand Down Expand Up @@ -229,7 +229,7 @@ describe('draggables', () => {
/>
</TestProviders>
);
expect(wrapper.text()).toBeNull();
expect(wrapper.isEmptyRender()).toBeTruthy();
});

test('it returns null if value is null', () => {
Expand All @@ -244,7 +244,7 @@ describe('draggables', () => {
/>
</TestProviders>
);
expect(wrapper.text()).toBeNull();
expect(wrapper.isEmptyRender()).toBeTruthy();
});

test('it returns Empty string text if value is an empty string', () => {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('Args', () => {
/>
</TestProviders>
);
expect(wrapper.text()).toBeNull();
expect(wrapper.isEmptyRender()).toBeTruthy();
});

test('it returns null if args is null', () => {
Expand All @@ -52,7 +52,7 @@ describe('Args', () => {
/>
</TestProviders>
);
expect(wrapper.text()).toBeNull();
expect(wrapper.isEmptyRender()).toBeTruthy();
});

test('it returns empty string if args happens to be an empty string', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('GenericDetails', () => {
/>
</TestProviders>
);
expect(wrapper.text()).toBeNull();
expect(wrapper.isEmptyRender()).toBeTruthy();
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('GenericFileDetails', () => {
/>
</TestProviders>
);
expect(wrapper.text()).toBeNull();
expect(wrapper.isEmptyRender()).toBeTruthy();
});
});

Expand Down
Loading