* Table: Max height for wrapped content
* Docs: tableNG max cell height (#110069)
Co-authored-by: Paul Marbach <paul.marbach@grafana.com>
* change to Max row height instead of Max cell height
* fix unit test
* table utils codeowners
* Update packages/grafana-ui/src/components/Table/TableNG/utils.ts
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
* update docs
* fix docs
* Revert "fix unit test"
This reverts commit c46b0f1bec.
* fix unit test
* trade one important for another
* Tweaked wording
* hover overflow for max row height
* get rid of commented out section
* and we did it without important
* centralize overflow for max height assessment
* some alignment stuff was busted
* didn't end up using the max heigh arg for shouldTextOverflow
* make i18n path more consistent
* put some tooltip things back since they ultimately didnt change
* we can simplify the :not selector
* delete comment
* don't bother with :not
---------
Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
import { test, expect } from '@grafana/plugin-e2e';
|
|
|
|
import { getCellHeight } from './table-utils';
|
|
|
|
test.use({
|
|
viewport: { width: 1280, height: 1080 },
|
|
});
|
|
|
|
const MARKDOWN_DASHBOARD_UID = '2769f5d8-0094-4ac4-a4f0-f68f620339cc';
|
|
|
|
test.describe(
|
|
'Panels test: Table - Markdown',
|
|
{
|
|
tag: ['@panels', '@table'],
|
|
},
|
|
() => {
|
|
test('Tests Markdown tables are successfully rendered', async ({ gotoDashboardPage, page }) => {
|
|
await gotoDashboardPage({
|
|
uid: MARKDOWN_DASHBOARD_UID,
|
|
queryParams: new URLSearchParams({ editPanel: '1' }),
|
|
});
|
|
|
|
await expect(page.getByRole('grid')).toBeVisible();
|
|
});
|
|
|
|
test('Tests dynamic height and max row height', async ({ gotoDashboardPage, page }) => {
|
|
await gotoDashboardPage({
|
|
uid: MARKDOWN_DASHBOARD_UID,
|
|
queryParams: new URLSearchParams({ editPanel: '1' }),
|
|
});
|
|
|
|
// confirm that the second row of the table is tall due to the content in it
|
|
await expect(getCellHeight(page, 2, 1)).resolves.toBeGreaterThan(100);
|
|
|
|
// set the max row height to 80, watch the row shrink
|
|
const maxRowHeightInput = page.getByLabel('Max row height').last();
|
|
await maxRowHeightInput.fill('80');
|
|
await expect(async () => {
|
|
await expect(getCellHeight(page, 2, 1)).resolves.toBeLessThan(100);
|
|
}).toPass();
|
|
});
|
|
}
|
|
);
|