@o3r/testing
Version:
The module provides testing (e2e, unit test) utilities to help you build your own E2E pipeline integrating visual testing.
30 lines • 1.05 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.O3rCheckboxElement = void 0;
const element_1 = require("../element");
/**
* Implementation dedicated to angular / TestBed.
*/
class O3rCheckboxElement extends element_1.O3rElement {
constructor(sourceElement) {
super(sourceElement);
}
/** @inheritDoc */
check(value = true, _associatedLabel) {
if (this.sourceElement.nativeElement) {
this.sourceElement.nativeElement.checked = value;
}
this.sourceElement.triggerEventHandler('change', { target: this.sourceElement.nativeElement, preventDefault: () => { }, stopPropagation: () => { } });
return Promise.resolve();
}
/** @inheritDoc */
uncheck() {
return this.check(false);
}
/** @inheritDoc */
isChecked() {
return Promise.resolve(this.sourceElement.nativeElement && this.sourceElement.nativeElement.checked);
}
}
exports.O3rCheckboxElement = O3rCheckboxElement;
//# sourceMappingURL=checkbox-element.js.map