The Toggle component renders a switch to toggle between enabled or disabled states.

Usage

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

const toggle = PlumaTestHelpers.extract('Toggle', screen.getByTestId('data-test-toggle'));

Test Helpers

Clicks the toggle

Gets the current checked state of the toggle

Checks if the toggle is disabled

Gets the label text of the toggle

Gets the name attribute of the toggle

Gets the value attribute of the toggle

Whether the toggle checked state matches the expected state

On this page