@nova-ui/bits
Version:
SolarWinds Nova Framework
25 lines • 1.18 kB
JavaScript
import { Atom } from "../../atom";
import { expect } from "../../setup";
export class TextboxAtom extends Atom {
constructor() {
super(...arguments);
this.acceptText = async (text) => this.input.fill(text);
this.toHaveValue = async (text) => await expect(this.input).toHaveValue(text);
this.clearText = async () => this.input.clear();
/** Clear using keyboard (Ctrl+A then Delete) */
this.deleteTextManually = async () => {
await this.input.press("Control+a");
await this.input.press("Delete");
};
this.toBeDisabled = async () => await expect(this.input).toBeDisabled();
this.toNotBeDisabled = async () => await expect(this.input).not.toBeDisabled();
this.toBeReadOnly = async () => await expect(this.input).toHaveAttribute("readonly", "");
this.toHaveError = async () => this.toContainClass("has-error");
this.toNotHaveError = async () => this.toNotContainClass("has-error");
}
static { this.CSS_CLASS = "nui-textbox"; }
get input() {
return super.getLocator().locator(".form-control");
}
}
//# sourceMappingURL=textbox.atom.js.map