fix(test): ExploreSortOrderFilter.spec and EntityVersionPages.spec (#23011)

* fix explore sort order test

* fix entity version page test

* fix load state

* minor fix

* fix test
This commit is contained in:
Pranita Fulsundar 2025-08-21 11:13:57 +05:30 committed by GitHub
parent abfb3a8e8a
commit 8a24e6d3a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 40 additions and 7 deletions

View File

@ -36,6 +36,7 @@ const creationConfig: EntityDataClassCreationConfig = {
apiEndpoint: true, apiEndpoint: true,
database: true, database: true,
databaseSchema: true, databaseSchema: true,
metric: true,
}; };
test.describe('Explore Sort Order Filter', () => { test.describe('Explore Sort Order Filter', () => {
@ -75,12 +76,30 @@ test.describe('Explore Sort Order Filter', () => {
} }
); );
await page.waitForSelector(`[data-testid="${filter}-checkbox"]`, {
state: 'visible',
});
await page.getByTestId(`${filter}-checkbox`).check(); await page.getByTestId(`${filter}-checkbox`).check();
await page.getByTestId('update-btn').click(); await page.getByTestId('update-btn').click();
await selectSortOrder(page, 'Name'); await selectSortOrder(page, 'Name');
await verifyEntitiesAreSorted(page); await verifyEntitiesAreSorted(page);
await page.getByRole('button', { name: 'Data Assets' }).click();
await page.waitForSelector(
'data-testid="drop-down-menu" data-testid="loader"',
{
state: 'detached',
}
);
await page.waitForSelector(`[data-testid="${filter}-checkbox"]`, {
state: 'visible',
});
await page.getByTestId(`${filter}-checkbox`).uncheck();
await page.getByTestId('update-btn').click();
await afterAction(); await afterAction();
}); });
}); });

View File

@ -159,7 +159,12 @@ test.describe('Entity Version pages', () => {
test.slow(); test.slow();
await entity.visitEntityPage(page); await entity.visitEntityPage(page);
const versionDetailResponse = page.waitForResponse(`**/versions/0.2`);
await page.waitForLoadState('networkidle');
const versionDetailResponse = page.waitForResponse(
(response) =>
response.url().includes('/versions/0.2') && response.status() === 200
);
await page.locator('[data-testid="version-button"]').click(); await page.locator('[data-testid="version-button"]').click();
await versionDetailResponse; await versionDetailResponse;

View File

@ -34,4 +34,5 @@ export interface EntityDataClassCreationConfig {
pipelineService?: boolean; pipelineService?: boolean;
searchIndexService?: boolean; searchIndexService?: boolean;
storageService?: boolean; storageService?: boolean;
metric?: boolean;
} }

View File

@ -127,7 +127,6 @@ export class EntityDataClass {
this.certificationTag1.create(apiContext), this.certificationTag1.create(apiContext),
this.certificationTag2.create(apiContext), this.certificationTag2.create(apiContext),
this.classification1.create(apiContext), this.classification1.create(apiContext),
this.metric1.create(apiContext),
] ]
: []; : [];
@ -205,6 +204,9 @@ export class EntityDataClass {
if (creationConfig?.all || creationConfig?.storageService) { if (creationConfig?.all || creationConfig?.storageService) {
promises.push(this.storageService.create(apiContext)); promises.push(this.storageService.create(apiContext));
} }
if (creationConfig?.all || creationConfig?.metric) {
promises.push(this.metric1.create(apiContext));
}
await Promise.allSettled(promises); await Promise.allSettled(promises);
@ -246,7 +248,6 @@ export class EntityDataClass {
this.dataProduct1.delete(apiContext), this.dataProduct1.delete(apiContext),
this.dataProduct2.delete(apiContext), this.dataProduct2.delete(apiContext),
this.dataProduct3.delete(apiContext), this.dataProduct3.delete(apiContext),
this.metric1.delete(apiContext),
] ]
: []; : [];
@ -324,6 +325,9 @@ export class EntityDataClass {
if (creationConfig?.all || creationConfig?.storageService) { if (creationConfig?.all || creationConfig?.storageService) {
promises.push(this.storageService.delete(apiContext)); promises.push(this.storageService.delete(apiContext));
} }
if (creationConfig?.all || creationConfig?.metric) {
promises.push(this.metric1.delete(apiContext));
}
return await Promise.allSettled(promises); return await Promise.allSettled(promises);
} }

View File

@ -410,10 +410,14 @@ export const DashboardChartTable = ({
}, [listChartIds, isCustomizationPage, initializeCharts]); }, [listChartIds, isCustomizationPage, initializeCharts]);
useEffect(() => { useEffect(() => {
setFilters({ const newShowDeletedValue =
showDeletedCharts: chartFilters.showDeletedCharts ?? dashboardDetails?.deleted;
chartFilters.showDeletedCharts ?? dashboardDetails?.deleted, // Only update if the value actually changed to prevent unnecessary navigation
}); if (chartFilters.showDeletedCharts !== newShowDeletedValue) {
setFilters({
showDeletedCharts: newShowDeletedValue,
});
}
}, [dashboardDetails?.deleted, chartFilters.showDeletedCharts, setFilters]); }, [dashboardDetails?.deleted, chartFilters.showDeletedCharts, setFilters]);
return ( return (