Skip to content

Commit

Permalink
tslint and eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Jan 27, 2023
1 parent dc6ff89 commit 02a3787
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,28 @@ import { pluginServices } from '../../../services/plugin_services';
import { DashboardGrid } from './dashboard_grid';
import { DashboardContainer } from '../../embeddable/dashboard_container';
import { getSampleDashboardInput } from '../../../mocks';

jest.mock('./dashboard_grid_item', () => ({
DashboardGridItem: require('react').forwardRef((props, ref) => {
const className =
props.expandedPanelId === undefined
? 'regularPanel'
: props.expandedPanelId === props.id
? 'expandedPanel'
: 'hiddenPanel';
return (
<div className={className} id={`mockDashboardGridItem_${props.id}`} ref={ref}>
mockDashboardGridItem
</div>
);
}),
}));
import type { Props as DashboardGridItemProps } from './dashboard_grid_item';

jest.mock('./dashboard_grid_item', () => {
return {
// eslint-disable-next-line @typescript-eslint/no-var-requires
DashboardGridItem: require('react').forwardRef(
(props: DashboardGridItemProps, ref: HTMLDivElement) => {
const className =
props.expandedPanelId === undefined
? 'regularPanel'
: props.expandedPanelId === props.id
? 'expandedPanel'
: 'hiddenPanel';
return (
<div className={className} id={`mockDashboardGridItem_${props.id}`}>
mockDashboardGridItem
</div>
);
}
),
};
});

const DashboardServicesProvider = pluginServices.getContextProvider();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { useDashboardContainerContext } from '../../dashboard_container_renderer

type DivProps = Pick<React.HTMLAttributes<HTMLDivElement>, 'className' | 'style' | 'children'>;

interface Props extends DivProps {
export interface Props extends DivProps {
id: DashboardPanelState['explicitInput']['id'];
index?: number;
type: DashboardPanelState['type'];
Expand Down

0 comments on commit 02a3787

Please sign in to comment.