Skip to content

Commit

Permalink
typescript and linting passes
Browse files Browse the repository at this point in the history
  • Loading branch information
rusackas committed Feb 25, 2025
1 parent d958c69 commit 491a9e0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion superset-frontend/src/__mocks__/antd-v5.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { theme } from '@superset-ui/core';
import { supersetTheme as theme } from '@superset-ui/core';

// Mock Menu component
const Menu = ({ children, ...props }: any) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
* under the License.
*/
import fetchMock from 'fetch-mock';
import {
render,
screen,
within,
} from 'spec/helpers/testing-library';
import { render, screen, within } from 'spec/helpers/testing-library';
import CssTemplateModal from './CssTemplateModal';
import { TemplateObject } from './types';

Expand Down
17 changes: 9 additions & 8 deletions superset-frontend/src/pages/DatasetList/DatasetList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/

import { ReactNode, createElement } from 'react';
import thunk from 'redux-thunk';
import configureStore from 'redux-mock-store';
import fetchMock from 'fetch-mock';
Expand Down Expand Up @@ -139,10 +140,10 @@ jest.mock('@superset-ui/core', () => {
// Mock Form
jest.mock('src/components/Form', () => ({
__esModule: true,
FormItem: ({ children }: { children: React.ReactNode }) => (
FormItem: ({ children }: { children: ReactNode }) => (
<div data-test="form-item">{children}</div>
),
Form: ({ children }: { children: React.ReactNode }) => (
Form: ({ children }: { children: ReactNode }) => (
<form data-test="form">{children}</form>
),
}));
Expand All @@ -151,7 +152,7 @@ jest.mock('src/components/Form', () => ({
jest.mock('antd', () => ({
...jest.requireActual('antd'),
Form: {
Item: ({ children }: { children: React.ReactNode }) => (
Item: ({ children }: { children: ReactNode }) => (
<div data-test="antd-form-item">{children}</div>
),
},
Expand Down Expand Up @@ -244,15 +245,15 @@ const ListView = ({
data,
columns,
}: ListViewProps) =>
React.createElement(
createElement(
'div',
{ 'data-test': 'list-view', role: 'table' },
[
bulkActions.length > 0 &&
React.createElement(
createElement(
'div',
{ key: 'bulk-select', 'data-test': 'bulk-select' },
React.createElement(
createElement(
'button',
{
type: 'button',
Expand All @@ -262,11 +263,11 @@ const ListView = ({
),
),
...(data?.map((row, i) =>
React.createElement(
createElement(
'div',
{ key: i, role: 'row' },
columns?.map((col, j) =>
React.createElement(
createElement(
'div',
{ key: j, role: 'cell' },
col.Cell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/

import { createElement } from 'react';
import thunk from 'redux-thunk';
import configureStore from 'redux-mock-store';
import fetchMock from 'fetch-mock';
Expand Down Expand Up @@ -227,15 +228,15 @@ interface ListViewProps {
}

const ListView = ({ children, data, columns }: ListViewProps) =>
React.createElement(
createElement(
'div',
{ 'data-test': 'list-view', role: 'table' },
data?.map((row, i) =>
React.createElement(
createElement(
'div',
{ key: i, role: 'row' },
columns?.map((col, j) =>
React.createElement(
createElement(
'div',
{ key: j, role: 'cell' },
col.Cell
Expand Down

0 comments on commit 491a9e0

Please sign in to comment.