keycloak-scim/js/apps/admin-ui/cypress/support/forms/Select.ts

21 lines
511 B
TypeScript
Raw Normal View History

export default class Select {
static assertSelectedItem(
chain: Cypress.Chainable<JQuery<HTMLElement>>,
itemName: string,
) {
chain.parent().should("have.text", itemName);
}
static selectItem(
chain: Cypress.Chainable<JQuery<HTMLElement>>,
itemName: string,
) {
chain.click();
this.#getSelectMenu(chain).contains(itemName).click();
}
static #getSelectMenu(chain: Cypress.Chainable<JQuery<HTMLElement>>) {
return chain.parent().get(".pf-v5-c-select__menu");
}
}