@angular/material
Version:
Angular Material
23 lines • 4.31 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("tslib"),require("@angular/cdk/coercion"),require("@angular/cdk/testing"),require("@angular/material/core/testing")):"function"==typeof define&&define.amd?define("@angular/material/autocomplete/testing",["exports","tslib","@angular/cdk/coercion","@angular/cdk/testing","@angular/material/core/testing"],e):e(((t=t||self).ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.autocomplete=t.ng.material.autocomplete||{},t.ng.material.autocomplete.testing={}),t.tslib,t.ng.cdk.coercion,t.ng.cdk.testing,t.ng.material.core.testing)}(this,(function(t,e,n,r,o){"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/var i=".mat-autocomplete-panel",a=function(t){function a(){var e=null!==t&&t.apply(this,arguments)||this;return e._documentRootLocator=e.documentRootLocatorFactory(),e._optionalPanel=e._documentRootLocator.locatorForOptional(i),e}return e.__extends(a,t),a.with=function(t){return void 0===t&&(t={}),new r.HarnessPredicate(a,t).addOption("value",t.value,(function(t,e){return r.HarnessPredicate.stringMatches(t.getValue(),e)}))},a.prototype.getValue=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){switch(t.label){case 0:return[4,this.host()];case 1:return[2,t.sent().getProperty("value")]}}))}))},a.prototype.isDisabled=function(){return e.__awaiter(this,void 0,void 0,(function(){var t,r;return e.__generator(this,(function(e){switch(e.label){case 0:return[4,this.host()];case 1:return t=e.sent().getAttribute("disabled"),r=n.coerceBooleanProperty,[4,t];case 2:return[2,r.apply(void 0,[e.sent()])]}}))}))},a.prototype.focus=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){switch(t.label){case 0:return[4,this.host()];case 1:return[2,t.sent().focus()]}}))}))},a.prototype.blur=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){switch(t.label){case 0:return[4,this.host()];case 1:return[2,t.sent().blur()]}}))}))},a.prototype.enterText=function(t){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(e){switch(e.label){case 0:return[4,this.host()];case 1:return[2,e.sent().sendKeys(t)]}}))}))},a.prototype.getOptions=function(t){return void 0===t&&(t={}),e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(n){return[2,this._documentRootLocator.locatorForAll(o.MatOptionHarness.with(e.__assign(e.__assign({},t),{ancestor:i})))()]}))}))},a.prototype.getOptionGroups=function(t){return void 0===t&&(t={}),e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(n){return[2,this._documentRootLocator.locatorForAll(o.MatOptgroupHarness.with(e.__assign(e.__assign({},t),{ancestor:i})))()]}))}))},a.prototype.selectOption=function(t){return e.__awaiter(this,void 0,void 0,(function(){var n;return e.__generator(this,(function(e){switch(e.label){case 0:return[4,this.focus()];case 1:return e.sent(),[4,this.getOptions(t)];case 2:if(!(n=e.sent()).length)throw Error("Could not find a mat-option matching "+JSON.stringify(t));return[4,n[0].click()];case 3:return e.sent(),[2]}}))}))},a.prototype.isOpen=function(){return e.__awaiter(this,void 0,void 0,(function(){var t,n;return e.__generator(this,(function(e){switch(e.label){case 0:return[4,this._optionalPanel()];case 1:return t=e.sent(),(n=!!t)?[4,t.hasClass("mat-autocomplete-visible")]:[3,3];case 2:n=e.sent(),e.label=3;case 3:return[2,n]}}))}))},a.hostSelector=".mat-autocomplete-trigger",a}(r.ComponentHarness);
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
t.MatAutocompleteHarness=a,Object.defineProperty(t,"__esModule",{value:!0})}));