UNPKG

@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.42 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.O3rCheckboxElement = void 0; var tslib_1 = require("tslib"); var element_1 = require("../element"); /** * Implementation dedicated to angular / TestBed. */ var O3rCheckboxElement = /** @class */ (function (_super) { tslib_1.__extends(O3rCheckboxElement, _super); function O3rCheckboxElement(sourceElement) { return _super.call(this, sourceElement) || this; } /** @inheritDoc */ O3rCheckboxElement.prototype.check = function (value, _associatedLabel) { 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 */ O3rCheckboxElement.prototype.uncheck = function () { return this.check(false); }; /** @inheritDoc */ O3rCheckboxElement.prototype.isChecked = function () { return Promise.resolve(this.sourceElement.nativeElement && this.sourceElement.nativeElement.checked); }; return O3rCheckboxElement; }(element_1.O3rElement)); exports.O3rCheckboxElement = O3rCheckboxElement; //# sourceMappingURL=checkbox-element.js.map