@o3r/testing
Version:
The module provides testing (e2e, unit test) utilities to help you build your own E2E pipeline integrating visual testing.
34 lines • 1.37 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.O3rRadioElement = void 0;
var tslib_1 = require("tslib");
var element_1 = require("../element");
/**
* Implementation dedicated to angular / TestBed.
*/
var O3rRadioElement = /** @class */ (function (_super) {
tslib_1.__extends(O3rRadioElement, _super);
function O3rRadioElement(sourceElement) {
return _super.call(this, sourceElement) || this;
}
/** @inheritDoc */
O3rRadioElement.prototype.check = function (value) {
if (value === void 0) { value = true; }
if (this.sourceElement.nativeElement) {
this.sourceElement.nativeElement.checked = value;
}
this.sourceElement.triggerEventHandler('change', { target: this.sourceElement.nativeElement, preventDefault: function () { }, stopPropagation: function () { } });
return Promise.resolve();
};
/** @inheritDoc */
O3rRadioElement.prototype.uncheck = function () {
return this.check(false);
};
/** @inheritDoc */
O3rRadioElement.prototype.isChecked = function () {
return Promise.resolve(this.sourceElement.nativeElement && this.sourceElement.nativeElement.checked);
};
return O3rRadioElement;
}(element_1.O3rElement));
exports.O3rRadioElement = O3rRadioElement;
//# sourceMappingURL=radio-element.js.map