Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
addKpi,
deleteKpiRequest,
deleteSeededKpisOnChart,
openDataInsightTab,
} from '../../utils/dataInsight';
import { waitForAllLoadersToDisappear } from '../../utils/entity';
import { sidebarClick } from '../../utils/sidebar';
Expand Down Expand Up @@ -136,7 +137,7 @@
// the stock layout instead of the persona's customizable one.
void persona;

const page = await browser.newPage();

Check warning on line 140 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/CustomizeWidgets.spec.ts

View workflow job for this annotation

GitHub Actions / checkstyle

Prefer the `page` fixture (test.use({ storageState })) over browser.newPage() + manual login for single-user admin tests. For multi-user tests that need a second non-admin page, this warning is expected — no action needed
await testUser.signIn(page);
await use(page);
await page.close();
Expand Down Expand Up @@ -313,7 +314,7 @@
await waitForAllLoadersToDisappear(page);

await sidebarClick(page, SidebarItem.DATA_INSIGHT);
await page.getByRole('link', { name: 'KPIs', exact: true }).click();
await openDataInsightTab(page, 'kpi');

await page.getByTestId('add-kpi-btn').click();
const createdKpi = await addKpi(page, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ import { expect, test } from '../../support/fixtures/isolatedUser';
import { okJson } from '../../utils/apiResponse';
import { createNewPage, redirectToHomePage, uuid } from '../../utils/common';
import { waitForLandingPageWidget } from '../../utils/customizeLandingPage';
import { addKpi, deleteKpiRequest } from '../../utils/dataInsight';
import {
addKpi,
deleteKpiRequest,
openDataInsightTab,
} from '../../utils/dataInsight';
import { waitForResponseWithStatus } from '../../utils/waitHelpers';

// use the admin user to login
Expand Down Expand Up @@ -95,7 +99,7 @@ test.describe('Data Insight Page', { tag: '@data-insight' }, () => {
test('Create description and owner KPI', async ({ page }) => {
await navigateToDataInsightPage(page);

await page.getByRole('link', { name: 'KPIs', exact: true }).click();
await openDataInsightTab(page, 'kpi');

for (const data of kpiData) {
await page.getByTestId('add-kpi-btn').click();
Expand Down Expand Up @@ -224,9 +228,7 @@ test.describe('Data Insight Page', { tag: '@data-insight' }, () => {
await page.getByTestId('date-picker-menu').click();
await page.getByRole('menuitem', { name: 'Last 60 days' }).click();

await page
.getByRole('link', { name: 'App Analytics', exact: true })
.click();
await openDataInsightTab(page, 'app-analytics');

await expect(page.getByTestId('summary-card-content')).toBeVisible();
await expect(
Expand Down Expand Up @@ -257,7 +259,7 @@ test.describe('Data Insight Page', { tag: '@data-insight' }, () => {
await percentageOfDataAssetWithDescriptionResponse;
await page.getByTestId('date-picker-menu').click();
await page.getByRole('menuitem', { name: 'Last 60 days' }).click();
await page.getByRole('link', { name: 'KPIs', exact: true }).click();
await openDataInsightTab(page, 'kpi');

await expect(page.getByTestId('kpi-card')).toBeVisible();
await expect(
Expand Down Expand Up @@ -289,7 +291,7 @@ test.describe('Data Insight Page', { tag: '@data-insight' }, () => {
await latestKPIResponse;
await percentageOfDataAssetWithDescriptionResponse;

await page.getByRole('link', { name: 'KPIs', exact: true }).click();
await openDataInsightTab(page, 'kpi');

for (const data of kpiData) {
await page.getByTestId(`edit-action-${data.displayName}`).click();
Expand Down Expand Up @@ -356,7 +358,7 @@ test.describe('Data Insight Page', { tag: '@data-insight' }, () => {
await latestKPIResponse;
await percentageOfDataAssetWithDescriptionResponse;

await page.getByRole('link', { name: 'KPIs', exact: true }).click();
await openDataInsightTab(page, 'kpi');

for (const data of kpiData) {
const kpi = getCreatedKpi(data.displayName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,10 @@ test.describe('Context Center - Document File Preview', () => {
const modal = await openFilePreviewModal(page, row, document.id);

await expect(
modal.getByRole('heading', { name: MARKDOWN_HEADING })
modal
.getByTestId('markdown-preview')
.getByRole('heading', { name: MARKDOWN_HEADING })
).toBeVisible();
await expect(modal.locator('[class*="tw:prose"]')).toBeVisible();
});

test('plain text file renders inside a pre block in the preview modal', async ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,11 @@ export const addKpi = async (page: Page, data: KPIData) => {

return { ...kpi, id: kpi.id, fullyQualifiedName: kpi.fullyQualifiedName };
};

export const openDataInsightTab = async (
page: Page,
tab: 'kpi' | 'app-analytics'
) => {
await page.getByTestId(`data-insight-tab-${tab}`).click();
await page.waitForURL(`**/data-insights/${tab}`);
};
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const MarkdownRenderer = ({ content }: PreviewRendererProps) => {
}, [content]);

return (
<div className="prose tw:max-w-none tw:p-4">
<div className="prose tw:max-w-none tw:p-4" data-testid="markdown-preview">
<ReactMarkdown components={getCustomMarkdownComponents()}>
{text}
</ReactMarkdown>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { DataInsightTabs } from '../../../interface/data-insight.interface';
import { getDataInsightPathWithFqn } from '../../../utils/DataInsightPureUtils';
import { useRequiredParams } from '../../../utils/useRequiredParams';
import DataInsightClassBase from '../DataInsightClassBase';

Check warning on line 21 in openmetadata-ui/src/main/resources/ui/src/pages/DataInsightPage/DataInsightLeftPanel/DataInsightLeftPanel.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency

const DataInsightLeftPanel = () => {
const { t } = useTranslation();
Expand All @@ -36,6 +36,7 @@
<li key={item.key}>
<NavItemBase
current={item.key === (tab ?? DataInsightTabs.DATA_ASSETS)}
dataTestId={`data-insight-tab-${item.key}`}
href={getDataInsightPathWithFqn(item.key)}
icon={item.icon}
size="sm"
Expand Down
Loading