!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/material/form-field/testing/control"),require("tslib"),require("@angular/cdk/testing"),require("@angular/material/input/testing"),require("@angular/material/select/testing")):"function"==typeof define&&define.amd?define("@angular/material/form-field/testing",["exports","@angular/material/form-field/testing/control","tslib","@angular/cdk/testing","@angular/material/input/testing","@angular/material/select/testing"],e):e(((t=t||self).ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.formField=t.ng.material.formField||{},t.ng.material.formField.testing={}),t.ng.material.formField.testing.control,t.tslib,t.ng.cdk.testing,t.ng.material.input.testing,t.ng.material.select.testing)}(this,(function(t,e,r,n,i,a){"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 o=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._prefixContainer=e.locatorForOptional(".mat-form-field-prefix"),e._suffixContainer=e.locatorForOptional(".mat-form-field-suffix"),e._label=e.locatorForOptional(".mat-form-field-label"),e._errors=e.locatorForAll(".mat-error"),e._hints=e.locatorForAll("mat-hint, .mat-hint"),e._inputControl=e.locatorForOptional(i.MatInputHarness),e._selectControl=e.locatorForOptional(a.MatSelectHarness),e}return r.__extends(e,t),e.with=function(t){var i=this;return void 0===t&&(t={}),new n.HarnessPredicate(e,t).addOption("floatingLabelText",t.floatingLabelText,(function(t,e){return r.__awaiter(i,void 0,void 0,(function(){var i,a;return r.__generator(this,(function(r){switch(r.label){case 0:return a=(i=n.HarnessPredicate).stringMatches,[4,t.getLabel()];case 1:return[2,a.apply(i,[r.sent(),e])]}}))}))})).addOption("hasErrors",t.hasErrors,(function(t,e){return r.__awaiter(i,void 0,void 0,(function(){return r.__generator(this,(function(r){switch(r.label){case 0:return[4,t.hasErrors()];case 1:return[2,r.sent()===e]}}))}))}))},e.prototype.getAppearance=function(){return r.__awaiter(this,void 0,void 0,(function(){var t,e;return r.__generator(this,(function(r){switch(r.label){case 0:return[4,this.host()];case 1:return[4,r.sent().getAttribute("class")];case 2:if(null!==(t=r.sent())&&(e=t.match(/mat-form-field-appearance-(legacy|standard|fill|outline)(?:$| )/)))return[2,e[1]];throw Error("Could not determine appearance of form-field.")}}))}))},e.prototype.getControl=function(t){return r.__awaiter(this,void 0,void 0,(function(){var e,n,i;return r.__generator(this,(function(a){switch(a.label){case 0:return t?[2,this.locatorForOptional(t)()]:[4,this.host()];case 1:return e=a.sent(),[4,Promise.all([e.hasClass("mat-form-field-type-mat-input"),e.hasClass("mat-form-field-type-mat-select")])];case 2:return n=r.__read.apply(void 0,[a.sent(),2]),i=n[1],n[0]?[2,this._inputControl()]:i?[2,this._selectControl()]:[2,null]}}))}))},e.prototype.hasLabel=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return[4,this.host()];case 1:return[2,t.sent().hasClass("mat-form-field-has-label")]}}))}))},e.prototype.getLabel=function(){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(e){switch(e.label){case 0:return[4,this._label()];case 1:return[2,(t=e.sent())?t.text():null]}}))}))},e.prototype.hasErrors=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return[4,this.getTextErrors()];case 1:return[2,t.sent().length>0]}}))}))},e.prototype.isLabelFloating=function(){return r.__awaiter(this,void 0,void 0,(function(){var t,e,n,i,a;return r.__generator(this,(function(o){switch(o.label){case 0:return i=(n=Promise).all,a=[this.hasLabel()],[4,this.host()];case 1:return[4,i.apply(n,[a.concat([o.sent().hasClass("mat-form-field-should-float")])])];case 2:return t=r.__read.apply(void 0,[o.sent(),2]),e=t[1],[2,t[0]&&e]}}))}))},e.prototype.isDisabled=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return[4,this.host()];case 1:return[2,t.sent().hasClass("mat-form-field-disabled")]}}))}))},e.prototype.isAutofilled=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return[4,this.host()];case 1:return[2,t.sent().hasClass("mat-form-field-autofilled")]}}))}))},e.prototype.getThemeColor=function(){return r.__awaiter(this,void 0,void 0,(function(){var t,e,n;return r.__generator(this,(function(i){switch(i.label){case 0:return[4,this.host()];case 1:return t=i.sent(),[4,Promise.all([t.hasClass("mat-accent"),t.hasClass("mat-warn")])];case 2:return e=r.__read.apply(void 0,[i.sent(),2]),n=e[1],e[0]?[2,"accent"]:n?[2,"warn"]:[2,"primary"]}}))}))},e.prototype.getTextErrors=function(){return r.__awaiter(this,void 0,void 0,(function(){var t,e;return r.__generator(this,(function(r){switch(r.label){case 0:return e=(t=Promise).all,[4,this._errors()];case 1:return[2,e.apply(t,[r.sent().map((function(t){return t.text()}))])]}}))}))},e.prototype.getTextHints=function(){return r.__awaiter(this,void 0,void 0,(function(){var t,e;return r.__generator(this,(function(r){switch(r.label){case 0:return e=(t=Promise).all,[4,this._hints()];case 1:return[2,e.apply(t,[r.sent().map((function(t){return t.text()}))])]}}))}))},e.prototype.getHarnessLoaderForPrefix=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this._prefixContainer()]}))}))},e.prototype.getHarnessLoaderForSuffix=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this._suffixContainer()]}))}))},e.prototype.isControlTouched=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return[4,this._hasFormControl()];case 1:return t.sent()?[4,this.host()]:[2,null];case 2:return[2,t.sent().hasClass("ng-touched")]}}))}))},e.prototype.isControlDirty=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return[4,this._hasFormControl()];case 1:return t.sent()?[4,this.host()]:[2,null];case 2:return[2,t.sent().hasClass("ng-dirty")]}}))}))},e.prototype.isControlValid=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return[4,this._hasFormControl()];case 1:return t.sent()?[4,this.host()]:[2,null];case 2:return[2,t.sent().hasClass("ng-valid")]}}))}))},e.prototype.isControlPending=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return[4,this._hasFormControl()];case 1:return t.sent()?[4,this.host()]:[2,null];case 2:return[2,t.sent().hasClass("ng-pending")]}}))}))},e.prototype._hasFormControl=function(){return r.__awaiter(this,void 0,void 0,(function(){var t,e,n;return r.__generator(this,(function(i){switch(i.label){case 0:return[4,this.host()];case 1:return t=i.sent(),[4,Promise.all([t.hasClass("ng-touched"),t.hasClass("ng-untouched")])];case 2:return e=r.__read.apply(void 0,[i.sent(),2]),n=e[1],[2,e[0]||n]}}))}))},e.hostSelector=".mat-form-field",e}(n.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 */Object.keys(e).forEach((function(r){"default"!==r&&Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})),t.MatFormFieldHarness=o,Object.defineProperty(t,"__esModule",{value:!0})}));