Skip to content

Commit

Permalink
Fix: Update data model header asset (#19729)
Browse files Browse the repository at this point in the history
* update data model header asset to include project

* add playwright test for project

* update entity test

* update condition for test
  • Loading branch information
sweta1308 authored Feb 11, 2025
1 parent b120748 commit d897332
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { test } from '@playwright/test';
import { expect, test } from '@playwright/test';
import { isUndefined } from 'lodash';
import { CustomPropertySupportedEntityList } from '../../constant/customProperty';
import { ApiEndpointClass } from '../../support/entity/ApiEndpointClass';
Expand Down Expand Up @@ -65,8 +65,9 @@ test.use({ storageState: 'playwright/.auth/admin.json' });
entities.forEach((EntityClass) => {
const entity = new EntityClass();
const deleteEntity = new EntityClass();
const entityName = entity.getType();

test.describe(entity.getType(), () => {
test.describe(entityName, () => {
test.beforeAll('Setup pre-requests', async ({ browser }) => {
const { apiContext, afterAction } = await createNewPage(browser);

Expand Down Expand Up @@ -192,6 +193,16 @@ entities.forEach((EntityClass) => {
);
});

if (['Dashboard', 'Dashboard Data Model'].includes(entityName)) {
test(`${entityName} page should show the project name`, async ({
page,
}) => {
await expect(
page.getByText((entity.entity as { project: string }).project)
).toBeVisible();
});
}

test('Update description', async ({ page }) => {
await entity.descriptionUpdate(page);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { EntityClass } from './EntityClass';
export class DashboardClass extends EntityClass {
private dashboardName = `pw-dashboard-${uuid()}`;
private dashboardDataModelName = `pw-dashboard-data-model-${uuid()}`;
private projectName = `pw-project-${uuid()}`;
service = {
name: `pw-dashboard-service-${uuid()}`,
serviceType: 'Superset',
Expand All @@ -51,6 +52,7 @@ export class DashboardClass extends EntityClass {
name: this.dashboardName,
displayName: this.dashboardName,
service: this.service.name,
project: this.projectName,
};
children = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ export const getDataAssetsHeaderInfo = (
value={dataModelDetails.dataModelType}
/>
)}
{dataModelDetails.project && (
<ExtraInfoLabel
label={t('label.project')}
value={dataModelDetails.project}
/>
)}
</>
);

Expand Down

0 comments on commit d897332

Please sign in to comment.