DataTable

Figma
Github
Storybook

DataTable enables users to act upon complex datasets with a variety of features including filtering and sorting.

Usage

import { PlumaTestHelpers } from '@customerio/pluma-components/react/test-helpers/pluma-test-helpers'

const dataTable = PlumaTestHelpers.extract('DataTable', screen.getByRole('table'));

Test Helpers

Clears the search input

Clicks on a row (for clickable rows)

Clicks on a row identified by its row ID (for clickable rows)

Deselects all rows by clicking the "deselect all" checkbox

Deselects a specific row by clicking its checkbox

Deselects a row identified by its row ID by clicking its checkbox

Gets the HTML element of a specific cell in a row identified by its row ID

Gets content of a specific cell in a row identified by its row ID

Gets array of visible column header texts

Gets current column order

Checks for error states

Checks if the table shows empty state

Checks if a specific row is selected

Checks if a row identified by its row ID is selected

Gets a row element by its zero-based index

Gets available actions for a specific row

Gets available actions for a row identified by its row ID

Gets a row element by its row ID

Checks if a row identified by its row ID is clickable

Gets the total number of data rows in the table

Gets content of all cells in a specific row

Gets content of all cells in a row identified by its row ID

Gets href if a row identified by its row ID is a link

Gets the current search query

Gets the number of selected rows

Gets list of currently visible columns

Gets the number of currently visible rows (accounting for pagination/filters)

Navigates to the next page

Navigates to the previous page

Checks if a button exists and is enabled

Checks if there are more pages available (next button enabled)

Checks if there are previous pages available (previous button enabled)

Checks if a row has action menu/buttons

Checks if a row identified by its row ID has action menu/buttons

Checks if search returned results

Triggers load more functionality

Triggers load new data

Focuses a specific cell in a row identified by its row ID

Focuses a row identified by its row ID

Opens the column settings dropdown

Clicks a specific row action on a row identified by its row ID

Presses Enter key on a specific row

Presses Enter key on a row identified by its row ID

Refreshes table data

Clicks the "select all" checkbox to select all rows

Selects a specific row by clicking its checkbox

Selects a row identified by its row ID by clicking its checkbox

Sorts the table by clicking a column header

Toggles column visibility via the Columns button

On this page