Skip to content

Commit 5dca30d

Browse files
committed
fix: tests
1 parent a655411 commit 5dca30d

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

superset-frontend/src/dashboard/components/PropertiesModal/PropertiesModal.test.tsx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,19 @@ describe('PropertiesModal', () => {
354354
mockedIsFeatureEnabled.mockReturnValue(false);
355355
const props = createProps();
356356
props.onlyApply = false;
357-
render(<PropertiesModal {...props} />, {
357+
// Pass dashboardInfo to avoid loading state
358+
const propsWithDashboardInfo = {
359+
...props,
360+
dashboardInfo: {
361+
...dashboardInfo,
362+
json_metadata: mockedJsonMetadata,
363+
},
364+
};
365+
render(<PropertiesModal {...propsWithDashboardInfo} />, {
358366
useRedux: true,
359367
});
368+
369+
// Wait for the form to be visible
360370
expect(
361371
await screen.findByTestId('dashboard-edit-properties-form'),
362372
).toBeInTheDocument();
@@ -379,9 +389,19 @@ describe('PropertiesModal', () => {
379389
mockedIsFeatureEnabled.mockReturnValue(false);
380390
const props = createProps();
381391
props.onlyApply = true;
382-
render(<PropertiesModal {...props} />, {
392+
// Pass dashboardInfo to avoid loading state
393+
const propsWithDashboardInfo = {
394+
...props,
395+
dashboardInfo: {
396+
...dashboardInfo,
397+
json_metadata: mockedJsonMetadata,
398+
},
399+
};
400+
render(<PropertiesModal {...propsWithDashboardInfo} />, {
383401
useRedux: true,
384402
});
403+
404+
// Wait for the form to be visible
385405
expect(
386406
await screen.findByTestId('dashboard-edit-properties-form'),
387407
).toBeInTheDocument();

0 commit comments

Comments
 (0)