Skip to content

Commit

Permalink
👌 Removed expect-errors directives
Browse files Browse the repository at this point in the history
  • Loading branch information
dej611 committed Mar 26, 2021
1 parent d0afe67 commit 6fbe08e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 25 deletions.
1 change: 1 addition & 0 deletions packages/kbn-test/src/jest/utils/enzyme_helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export function mountWithIntl<T>(
childContextTypes,
...props
}: {
attachTo?: HTMLElement;
context?: any;
childContextTypes?: ValidationMap<any>;
} = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { generateId } from '../../../id_generator';

jest.mock('../../../id_generator');

let container: HTMLDivElement | null;
let container: HTMLDivElement | undefined;

beforeEach(() => {
container = document.createElement('div');
Expand All @@ -35,7 +35,7 @@ afterEach(() => {
container.parentNode.removeChild(container);
}

container = null;
container = undefined;
});

describe('ConfigPanel', () => {
Expand Down Expand Up @@ -121,11 +121,9 @@ describe('ConfigPanel', () => {

describe('focus behavior when adding or removing layers', () => {
it('should focus the only layer when resetting the layer', () => {
const component = mountWithIntl(
<LayerPanels {...getDefaultProps()} />,
// @ts-expect-error
{ attachTo: container }
);
const component = mountWithIntl(<LayerPanels {...getDefaultProps()} />, {
attachTo: container,
});
const firstLayerFocusable = component
.find(LayerPanel)
.first()
Expand All @@ -146,11 +144,7 @@ describe('ConfigPanel', () => {
first: mockDatasource.publicAPIMock,
second: mockDatasource.publicAPIMock,
};
const component = mountWithIntl(
<LayerPanels {...defaultProps} />,
// @ts-expect-error
{ attachTo: container }
);
const component = mountWithIntl(<LayerPanels {...defaultProps} />, { attachTo: container });
const secondLayerFocusable = component
.find(LayerPanel)
.at(1)
Expand All @@ -171,11 +165,7 @@ describe('ConfigPanel', () => {
first: mockDatasource.publicAPIMock,
second: mockDatasource.publicAPIMock,
};
const component = mountWithIntl(
<LayerPanels {...defaultProps} />,
// @ts-expect-error
{ attachTo: container }
);
const component = mountWithIntl(<LayerPanels {...defaultProps} />, { attachTo: container });
const firstLayerFocusable = component
.find(LayerPanel)
.first()
Expand All @@ -197,11 +187,9 @@ describe('ConfigPanel', () => {
}
});

const component = mountWithIntl(
<LayerPanels {...getDefaultProps()} dispatch={dispatch} />,
// @ts-expect-error
{ attachTo: container }
);
const component = mountWithIntl(<LayerPanels {...getDefaultProps()} dispatch={dispatch} />, {
attachTo: container,
});
act(() => {
component.find('[data-test-subj="lnsLayerAddButton"]').first().simulate('click');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {

jest.mock('../../../id_generator');

let container: HTMLDivElement | null;
let container: HTMLDivElement | undefined;

beforeEach(() => {
container = document.createElement('div');
Expand All @@ -36,7 +36,7 @@ afterEach(() => {
container.parentNode.removeChild(container);
}

container = null;
container = undefined;
});

const defaultContext = {
Expand Down Expand Up @@ -659,7 +659,6 @@ describe('LayerPanel', () => {
<ChildDragDropProvider {...defaultContext} dragging={draggingOperation}>
<LayerPanel {...getDefaultProps()} />
</ChildDragDropProvider>,
// @ts-expect-error
{ attachTo: container }
);
act(() => {
Expand Down

0 comments on commit 6fbe08e

Please sign in to comment.