@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
30 lines • 1.34 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
// 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 token_1 = require("./token");
const styles_selectors_js_1 = require("../../../internal/components/token-list/styles.selectors.js");
const styles_selectors_js_2 = require("../../../token-group/styles.selectors.js");
class TokenGroupWrapper extends selectors_1.ComponentWrapper {
findTokens() {
return this.findAllByClassName(token_1.default.rootSelector).map(tokenElement => new token_1.default(tokenElement.getElement()));
}
/**
* Returns a token from the group for a given index.
*
* @param tokenIndex 1-based index of the token to return.
*/
findToken(tokenIndex) {
return this.findComponent(`.${styles_selectors_js_1.default['list-item']}:nth-child(${tokenIndex}) > .${token_1.default.rootSelector}`, token_1.default);
}
/**
* Returns the token toggle button.
*/
findTokenToggle() {
return this.findByClassName(styles_selectors_js_1.default.toggle);
}
}
exports.default = TokenGroupWrapper;
TokenGroupWrapper.rootSelector = styles_selectors_js_2.default.root;
//# sourceMappingURL=index.js.map