Learn about visual thememore

Selection box

Selection boxes present users with a choice to make or a question to answer before proceeding with a one-time process.

Demo

SKY UX test harnesses are built upon Angular CDK component harnesses. For more information see the Angular CDK component harness documentation.

Link for section titled SkySelectionBoxHarness
SkySelectionBoxHarness

Type: Class

import { SkySelectionBoxHarness } from '@skyux/forms/testing';

Harness to interact with a selection box component in tests.

Methods

getControl(): Promise<SkyCheckboxHarness | SkyRadioHarness>

Gets the checkbox or radio harness for the selection box form control.

Returns

Promise<SkyCheckboxHarness | SkyRadioHarness>

getDescriptionText(): Promise<string>

Gets the selection box description text.

Returns

Promise<string>

getHeaderText(): Promise<string>

Gets the selection box header text.

Returns

Promise<string>

getIcon(): Promise<null | SkyIconHarness>

Gets the selection box icon, if it exists.

Returns

Promise<null | SkyIconHarness>

SkySelectionBoxHarness.with(filters: SkySelectionBoxHarnessFilters): HarnessPredicate<SkySelectionBoxHarness>

Gets a HarnessPredicate that can be used to search for a SkySelectionBoxHarness that meets certain criteria.

Parameters

filters: SkySelectionBoxHarnessFilters

Returns

HarnessPredicate<SkySelectionBoxHarness>

Link for section titled SkySelectionBoxHarnessFilters
SkySelectionBoxHarnessFilters

Type: Interface

A set of criteria that can be used to filter a list of SkySelectionBoxHarness instances.

interface SkySelectionBoxHarnessFilters {
  dataSkyId?: string | RegExp;
}

Properties

dataSkyId?: string | RegExp

Only find instances whose data-sky-id attribute matches the given value.

Link for section titled SkySelectionBoxGridHarness
SkySelectionBoxGridHarness

Type: Class

import { SkySelectionBoxGridHarness } from '@skyux/forms/testing';

Harness for interacting with a selection box grid component in tests.

Methods

getSelectionBox(filter: SkySelectionBoxHarnessFilters): Promise<SkySelectionBoxHarness>

Gets a harness for a specific selection box that meets certain criteria.

Parameters

filter: SkySelectionBoxHarnessFilters

Returns

Promise<SkySelectionBoxHarness>

getSelectionBoxes(filters?: SkySelectionBoxHarnessFilters): Promise<SkySelectionBoxHarness[]>

Gets an array of selection boxes.

Parameters

filters?: SkySelectionBoxHarnessFilters

Returns

Promise<SkySelectionBoxHarness[]>

SkySelectionBoxGridHarness.with(filters: SkySelectionBoxGridHarnessFilters): HarnessPredicate<SkySelectionBoxGridHarness>

Gets a HarnessPredicate that can be used to search for a SkySelectionBoxGridHarness that meets certain criteria.

Parameters

filters: SkySelectionBoxGridHarnessFilters

Returns

HarnessPredicate<SkySelectionBoxGridHarness>

Link for section titled SkySelectionBoxGridHarnessFilters
SkySelectionBoxGridHarnessFilters

Type: Interface

A set of criteria that can be used to filter a list of SkySelectionBoxGridHarness instances.

interface SkySelectionBoxGridHarnessFilters {
  dataSkyId?: string | RegExp;
}

Properties

dataSkyId?: string | RegExp

Only find instances whose data-sky-id attribute matches the given value.