@awsui/components-react
Version:
On July 19th, 2022, we launched [Cloudscape Design System](https://cloudscape.design). Cloudscape is an evolution of AWS-UI. It consists of user interface guidelines, front-end components, design resources, and development tools for building intuitive, en
32 lines • 1.33 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SegmentWrapper = void 0;
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
const selectors_1 = require("@awsui/test-utils-core/selectors");
const styles_selectors_js_1 = require("../../../segmented-control/styles.selectors.js");
class SegmentWrapper extends selectors_1.ComponentWrapper {
findDisabledReason() {
return (0, selectors_1.createWrapper)().find(`.${styles_selectors_js_1.default['disabled-reason-tooltip']}`);
}
}
exports.SegmentWrapper = SegmentWrapper;
class SegmentedControlWrapper extends selectors_1.ComponentWrapper {
findSegments() {
return this.findAllByClassName(styles_selectors_js_1.default.segment);
}
findSelectedSegment() {
return this.findByClassName(styles_selectors_js_1.default.selected);
}
/**
* Finds the segment with the given ID.
*
* @param id ID of the element to return.
*/
findSegmentById(id) {
return this.findComponent(`.${styles_selectors_js_1.default.segment}[data-testid="${id}"]`, SegmentWrapper);
}
}
exports.default = SegmentedControlWrapper;
SegmentedControlWrapper.rootSelector = styles_selectors_js_1.default.root;
//# sourceMappingURL=index.js.map