Skip to content

Commit 8a24e6d

Browse files
authored
fix(test): ExploreSortOrderFilter.spec and EntityVersionPages.spec (open-metadata#23011)
* fix explore sort order test * fix entity version page test * fix load state * minor fix * fix test
1 parent abfb3a8 commit 8a24e6d

File tree

5 files changed

+40
-7
lines changed

5 files changed

+40
-7
lines changed

openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ExploreSortOrderFilter.spec.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const creationConfig: EntityDataClassCreationConfig = {
3636
apiEndpoint: true,
3737
database: true,
3838
databaseSchema: true,
39+
metric: true,
3940
};
4041

4142
test.describe('Explore Sort Order Filter', () => {
@@ -75,12 +76,30 @@ test.describe('Explore Sort Order Filter', () => {
7576
}
7677
);
7778

79+
await page.waitForSelector(`[data-testid="${filter}-checkbox"]`, {
80+
state: 'visible',
81+
});
7882
await page.getByTestId(`${filter}-checkbox`).check();
7983
await page.getByTestId('update-btn').click();
8084

8185
await selectSortOrder(page, 'Name');
8286
await verifyEntitiesAreSorted(page);
8387

88+
await page.getByRole('button', { name: 'Data Assets' }).click();
89+
90+
await page.waitForSelector(
91+
'data-testid="drop-down-menu" data-testid="loader"',
92+
{
93+
state: 'detached',
94+
}
95+
);
96+
97+
await page.waitForSelector(`[data-testid="${filter}-checkbox"]`, {
98+
state: 'visible',
99+
});
100+
await page.getByTestId(`${filter}-checkbox`).uncheck();
101+
await page.getByTestId('update-btn').click();
102+
84103
await afterAction();
85104
});
86105
});

openmetadata-ui/src/main/resources/ui/playwright/e2e/VersionPages/EntityVersionPages.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,12 @@ test.describe('Entity Version pages', () => {
159159
test.slow();
160160

161161
await entity.visitEntityPage(page);
162-
const versionDetailResponse = page.waitForResponse(`**/versions/0.2`);
162+
163+
await page.waitForLoadState('networkidle');
164+
const versionDetailResponse = page.waitForResponse(
165+
(response) =>
166+
response.url().includes('/versions/0.2') && response.status() === 200
167+
);
163168
await page.locator('[data-testid="version-button"]').click();
164169
await versionDetailResponse;
165170

openmetadata-ui/src/main/resources/ui/playwright/support/entity/EntityDataClass.interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ export interface EntityDataClassCreationConfig {
3434
pipelineService?: boolean;
3535
searchIndexService?: boolean;
3636
storageService?: boolean;
37+
metric?: boolean;
3738
}

openmetadata-ui/src/main/resources/ui/playwright/support/entity/EntityDataClass.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ export class EntityDataClass {
127127
this.certificationTag1.create(apiContext),
128128
this.certificationTag2.create(apiContext),
129129
this.classification1.create(apiContext),
130-
this.metric1.create(apiContext),
131130
]
132131
: [];
133132

@@ -205,6 +204,9 @@ export class EntityDataClass {
205204
if (creationConfig?.all || creationConfig?.storageService) {
206205
promises.push(this.storageService.create(apiContext));
207206
}
207+
if (creationConfig?.all || creationConfig?.metric) {
208+
promises.push(this.metric1.create(apiContext));
209+
}
208210

209211
await Promise.allSettled(promises);
210212

@@ -246,7 +248,6 @@ export class EntityDataClass {
246248
this.dataProduct1.delete(apiContext),
247249
this.dataProduct2.delete(apiContext),
248250
this.dataProduct3.delete(apiContext),
249-
this.metric1.delete(apiContext),
250251
]
251252
: [];
252253

@@ -324,6 +325,9 @@ export class EntityDataClass {
324325
if (creationConfig?.all || creationConfig?.storageService) {
325326
promises.push(this.storageService.delete(apiContext));
326327
}
328+
if (creationConfig?.all || creationConfig?.metric) {
329+
promises.push(this.metric1.delete(apiContext));
330+
}
327331

328332
return await Promise.allSettled(promises);
329333
}

openmetadata-ui/src/main/resources/ui/src/components/Dashboard/DashboardChartTable/DashboardChartTable.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,14 @@ export const DashboardChartTable = ({
410410
}, [listChartIds, isCustomizationPage, initializeCharts]);
411411

412412
useEffect(() => {
413-
setFilters({
414-
showDeletedCharts:
415-
chartFilters.showDeletedCharts ?? dashboardDetails?.deleted,
416-
});
413+
const newShowDeletedValue =
414+
chartFilters.showDeletedCharts ?? dashboardDetails?.deleted;
415+
// Only update if the value actually changed to prevent unnecessary navigation
416+
if (chartFilters.showDeletedCharts !== newShowDeletedValue) {
417+
setFilters({
418+
showDeletedCharts: newShowDeletedValue,
419+
});
420+
}
417421
}, [dashboardDetails?.deleted, chartFilters.showDeletedCharts, setFilters]);
418422

419423
return (

0 commit comments

Comments
 (0)