!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("tslib"),require("@angular/cdk/testing")):"function"==typeof define&&define.amd?define("@angular/material/tabs/testing",["exports","tslib","@angular/cdk/testing"],e):e(((t=t||self).ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.tabs=t.ng.material.tabs||{},t.ng.material.tabs.testing={}),t.tslib,t.ng.cdk.testing)}(this,(function(t,e,r){"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 n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(n,t),n.with=function(t){return void 0===t&&(t={}),new r.HarnessPredicate(n,t).addOption("label",t.label,(function(t,e){return r.HarnessPredicate.stringMatches(t.getLabel(),e)}))},n.prototype.getLabel=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().text()]}}))}))},n.prototype.getAriaLabel=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().getAttribute("aria-label")]}}))}))},n.prototype.getAriaLabelledby=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().getAttribute("aria-labelledby")]}}))}))},n.prototype.isSelected=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[4,t.sent().getAttribute("aria-selected")];case 2:return[2,"true"===t.sent()]}}))}))},n.prototype.isDisabled=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[4,t.sent().getAttribute("aria-disabled")];case 2:return[2,"true"===t.sent()]}}))}))},n.prototype.select=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[4,t.sent().click()];case 2:return t.sent(),[2]}}))}))},n.prototype.getTextContent=function(){return e.__awaiter(this,void 0,void 0,(function(){var t;return e.__generator(this,(function(e){switch(e.label){case 0:return[4,this._getContentId()];case 1:return t=e.sent(),[4,this.documentRootLocatorFactory().locatorFor("#"+t)()];case 2:return[2,e.sent().text()]}}))}))},n.prototype.getHarnessLoaderForContent=function(){return e.__awaiter(this,void 0,void 0,(function(){var t;return e.__generator(this,(function(e){switch(e.label){case 0:return[4,this._getContentId()];case 1:return t=e.sent(),[2,this.documentRootLocatorFactory().harnessLoaderFor("#"+t)]}}))}))},n.prototype._getContentId=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[4,t.sent().getAttribute("aria-controls")];case 2:return[2,t.sent()]}}))}))},n.hostSelector=".mat-tab-label",n}(r.ComponentHarness),i=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(i,t),i.with=function(t){var n=this;return void 0===t&&(t={}),new r.HarnessPredicate(i,t).addOption("selectedTabLabel",t.selectedTabLabel,(function(t,i){return e.__awaiter(n,void 0,void 0,(function(){var n,a,o;return e.__generator(this,(function(e){switch(e.label){case 0:return[4,t.getSelectedTab()];case 1:return n=e.sent(),o=(a=r.HarnessPredicate).stringMatches,[4,n.getLabel()];case 2:return[2,o.apply(a,[e.sent(),i])]}}))}))}))},i.prototype.getTabs=function(t){return void 0===t&&(t={}),e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(e){return[2,this.locatorForAll(n.with(t))()]}))}))},i.prototype.getSelectedTab=function(){return e.__awaiter(this,void 0,void 0,(function(){var t,r,n;return e.__generator(this,(function(e){switch(e.label){case 0:return[4,this.getTabs()];case 1:return t=e.sent(),[4,Promise.all(t.map((function(t){return t.isSelected()})))];case 2:for(r=e.sent(),n=0;n<t.length;n++)if(r[n])return[2,t[n]];throw new Error("No selected tab could be found.")}}))}))},i.prototype.selectTab=function(t){return void 0===t&&(t={}),e.__awaiter(this,void 0,void 0,(function(){var r;return e.__generator(this,(function(e){switch(e.label){case 0:return[4,this.getTabs(t)];case 1:if(!(r=e.sent()).length)throw Error("Cannot find mat-tab matching filter "+JSON.stringify(t));return[4,r[0].select()];case 2:return e.sent(),[2]}}))}))},i.hostSelector=".mat-tab-group",i}(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 */ /** * @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.MatTabGroupHarness=i,t.MatTabHarness=n,Object.defineProperty(t,"__esModule",{value:!0})}));