import {Page} from '@playwright/test';
import DashboardPage from '../../../page-objects/dashboard/DashboardPage';
import {RobotChartsDashboardUrls} from '../../../utils/constants';
import datalensTest from '../../../utils/playwright/globalTestDefinition';
import {openTestPage} from '../../../utils';
const expectedHTML = `
This text is highlighted in bold.
This text is in italics.
-
Element 1
-
Element 2
-
Element 3
`;
datalensTest.describe('Dashboards - Markdown', () => {
datalensTest('Markdown should turn into HTML tags', async ({page}: {page: Page}) => {
const dashboardPage = new DashboardPage({page});
await openTestPage(page, RobotChartsDashboardUrls.DashnboardWithMarkdown);
const receivedHTML = await dashboardPage.getMarkdownHTML();
const hasText = receivedHTML.trim().includes(expectedHTML.trim());
expect(hasText).toBeTruthy();
});
});