Skip to content

Commit f2d9965

Browse files
rusackasclaude
andcommitted
fix: proper TypeScript types in test file
- Use GenericDataType enum instead of numeric literals - Cast data through unknown to satisfy strict TypeScript checking Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 11d69ac commit f2d9965

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

superset-frontend/src/explore/components/DataTablesPane/test/SingleQueryResultPane.test.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
waitFor,
2323
userEvent,
2424
} from 'spec/helpers/testing-library';
25+
import { GenericDataType } from '@apache-superset/core/api/core';
2526
import { SingleQueryResultPane } from '../components/SingleQueryResultPane';
2627

2728
// Mock data matching what useFilteredTableData expects: Record<string, any>[]
@@ -37,10 +38,14 @@ const mockData: Record<string, unknown>[] = Array.from(
3738
const defaultProps = {
3839
// Note: The SingleQueryResultPaneProp type expects Record<string, any>[][]
3940
// but useFilteredTableData and useTableColumns actually work with Record<string, any>[]
40-
// This type mismatch exists in the codebase
41-
data: mockData as Record<string, unknown>[][],
41+
// This type mismatch exists in the codebase - cast through unknown to satisfy TypeScript
42+
data: mockData as unknown as Record<string, unknown>[][],
4243
colnames: ['id', 'name', 'category'],
43-
coltypes: [0, 1, 1] as const, // numeric, string, string
44+
coltypes: [
45+
GenericDataType.Numeric,
46+
GenericDataType.String,
47+
GenericDataType.String,
48+
],
4449
rowcount: 30,
4550
datasourceId: '1__table',
4651
dataSize: 10, // 10 items per page, so 3 pages total

0 commit comments

Comments
 (0)