Badges are read-only indicators used to communicate a category, metadata, a numeric quantity, or a process's current state.

Usage

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

const badge = PlumaTestHelpers.extract('Badge', screen.getByTestId('data-test-badge'));

Test Helpers

Gets the color of the badge, or `null` when no `color` prop was set. Semantic color values report as their underlying color (e.g. `color="critical"` reports `red`).

Gets whether the badge shows a status indicator dot

Gets whether the badge is in emphasized variant

Gets whether the badge is in outlined variant

Gets the semantic meaning of the badge color (`critical`, `caution`, `success`, or `information`), or `null` when the color has no semantic meaning. Semantic values and their underlying colors report identically (e.g. `color="critical"` and `color="red"` both return `critical`).

Gets the text content of the badge

Whether the badge text matches the expected text

On this page