From 4ab7a1ca4afcdc960a8448d978bb0d5b28cd757d Mon Sep 17 00:00:00 2001 From: Mert Akinc <7282195+m-akinc@users.noreply.github.com> Date: Mon, 28 Oct 2024 19:49:32 -0500 Subject: [PATCH] Add a table page object function to get an icon's severity --- .../src/table/testing/table.pageobject.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/nimble-components/src/table/testing/table.pageobject.ts b/packages/nimble-components/src/table/testing/table.pageobject.ts index 8cc66039e1..c35b21d1c5 100644 --- a/packages/nimble-components/src/table/testing/table.pageobject.ts +++ b/packages/nimble-components/src/table/testing/table.pageobject.ts @@ -20,6 +20,7 @@ import type { Button } from '../../button'; import { Icon } from '../../icon-base'; import { Spinner, spinnerTag } from '../../spinner'; import { borderHoverColor } from '../../theme-provider/design-tokens'; +import { IconSeverity } from '../../icon-base/types'; /** * Summary information about a column that is sorted in the table for use in the `TablePageObject`. @@ -207,6 +208,18 @@ export class TablePageObject { return iconOrSpinner.tagName.toLocaleLowerCase(); } + public getRenderedMappingColumnCellIconSeverity( + rowIndex: number, + columnIndex: number + ): IconSeverity { + const iconOrSpinner = this.getRenderedMappingColumnIconOrSpinner( + this.getRenderedCellView(rowIndex, columnIndex) + ); + return iconOrSpinner instanceof Icon + ? iconOrSpinner.severity + : undefined; + } + public getRenderedGroupHeaderTextContent(groupRowIndex: number): string { return ( this.getGroupRowHeaderView(