fix src/core/public/application react/no-danger violations (#51146)

This commit is contained in:
Pierre Gayvallet 2019-11-20 18:07:18 +01:00 committed by GitHub
parent 35b0362177
commit 5a93c13420
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 14 deletions

View file

@ -64,12 +64,6 @@ module.exports = {
'jsx-a11y/no-onchange': 'off',
},
},
{
files: ['src/core/public/application/**/*.{js,ts,tsx}'],
rules: {
'react/no-danger': 'off',
},
},
{
files: ['src/legacy/core_plugins/console/**/*.{js,ts,tsx}'],
rules: {

View file

@ -18,7 +18,6 @@
*/
import React from 'react';
import ReactDOM from 'react-dom';
import { mount, ReactWrapper } from 'enzyme';
import { createMemoryHistory, History } from 'history';
import { BehaviorSubject } from 'rxjs';
@ -31,13 +30,8 @@ import { AppRouter, AppNotFound } from '../ui';
const createMountHandler = (htmlString: string) =>
jest.fn(async ({ appBasePath: basename, element: el }: AppMountParameters) => {
ReactDOM.render(
<div
dangerouslySetInnerHTML={{ __html: `\nbasename: ${basename}\nhtml: ${htmlString}\n` }}
/>,
el
);
return jest.fn(() => ReactDOM.unmountComponentAtNode(el));
el.innerHTML = `<div>\nbasename: ${basename}\nhtml: ${htmlString}\n</div>`;
return jest.fn(() => (el.innerHTML = ''));
});
describe('AppContainer', () => {