Skip to content

Commit

Permalink
Add a table page object function to get an icon's severity
Browse files Browse the repository at this point in the history
  • Loading branch information
m-akinc committed Oct 29, 2024
1 parent 92ad2f5 commit 4ab7a1c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/nimble-components/src/table/testing/table.pageobject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -207,6 +208,18 @@ export class TablePageObject<T extends TableRecord> {
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(
Expand Down

0 comments on commit 4ab7a1c

Please sign in to comment.