Skip to content

Commit 3cdc0b7

Browse files
sadpandajoeclaude
andcommitted
fix(dashboard): correct waitForAsyncData mock types in FiltersConfigForm test
- Fix asyncResolve type from MockChartDataResponse to unknown[] to match waitForAsyncData return type - Fix asyncPromise type from Promise<MockChartDataResponse> to Promise<unknown[]> - Replace createMockChartResponse() call with correct result array structure waitForAsyncData returns Promise<ChartDataResponseResult[]> (array of results), not the full response wrapper object. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 71ce65b commit 3cdc0b7

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.test.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,8 @@ test('should cleanup when unmounted during async operation', async () => {
635635
mockGetChartDataRequest.mockResolvedValue(createMockAsyncChartResponse());
636636

637637
// Mock a slow async operation
638-
let asyncResolve!: (value: MockChartDataResponse) => void;
639-
const asyncPromise = new Promise<MockChartDataResponse>(resolve => {
638+
let asyncResolve!: (value: unknown[]) => void;
639+
const asyncPromise = new Promise<unknown[]>(resolve => {
640640
asyncResolve = resolve;
641641
});
642642
mockWaitForAsyncData.mockReturnValue(asyncPromise);
@@ -676,7 +676,13 @@ test('should cleanup when unmounted during async operation', async () => {
676676
unmount();
677677

678678
// Now resolve the async operation after unmount
679-
asyncResolve(createMockChartResponse([{ name: 'Delayed', count: 1 }]));
679+
asyncResolve([
680+
{
681+
status: 'success',
682+
data: [{ name: 'Delayed', count: 1 }],
683+
applied_filters: [],
684+
},
685+
]);
680686

681687
// Wait a bit to ensure any state updates would have happened
682688
await new Promise(resolve => setTimeout(resolve, 100));

0 commit comments

Comments
 (0)