@angular/material
Version:
Angular Material
23 lines • 6.38 kB
JavaScript
!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/expansion/testing",["exports","tslib","@angular/cdk/testing"],e):e(((t=t||self).ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.expansion=t.ng.material.expansion||{},t.ng.material.expansion.testing={}),t.tslib,t.ng.cdk.testing)}(this,(function(t,e,n){"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 r=".mat-expansion-panel-content",i=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e._header=e.locatorFor(".mat-expansion-panel-header"),e._title=e.locatorForOptional(".mat-expansion-panel-header-title"),e._description=e.locatorForOptional(".mat-expansion-panel-header-description"),e._expansionIndicator=e.locatorForOptional(".mat-expansion-indicator"),e._content=e.locatorFor(r),e}return e.__extends(i,t),i.with=function(t){var r=this;return void 0===t&&(t={}),new n.HarnessPredicate(i,t).addOption("title",t.title,(function(t,e){return n.HarnessPredicate.stringMatches(t.getTitle(),e)})).addOption("description",t.description,(function(t,e){return n.HarnessPredicate.stringMatches(t.getDescription(),e)})).addOption("content",t.content,(function(t,e){return n.HarnessPredicate.stringMatches(t.getTextContent(),e)})).addOption("expanded",t.expanded,(function(t,n){return e.__awaiter(r,void 0,void 0,(function(){return e.__generator(this,(function(e){switch(e.label){case 0:return[4,t.isExpanded()];case 1:return[2,e.sent()===n]}}))}))})).addOption("disabled",t.disabled,(function(t,n){return e.__awaiter(r,void 0,void 0,(function(){return e.__generator(this,(function(e){switch(e.label){case 0:return[4,t.isDisabled()];case 1:return[2,e.sent()===n]}}))}))}))},i.prototype.isExpanded=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().hasClass("mat-expanded")]}}))}))},i.prototype.getTitle=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._title()];case 1:return[2,(t=e.sent())?t.text():null]}}))}))},i.prototype.getDescription=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._description()];case 1:return[2,(t=e.sent())?t.text():null]}}))}))},i.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._header()];case 1:return[4,t.sent().getAttribute("aria-disabled")];case 2:return[2,"true"===t.sent()]}}))}))},i.prototype.toggle=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){switch(t.label){case 0:return[4,this._header()];case 1:return[4,t.sent().click()];case 2:return t.sent(),[2]}}))}))},i.prototype.expand=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){switch(t.label){case 0:return[4,this.isExpanded()];case 1:return t.sent()?[3,3]:[4,this.toggle()];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},i.prototype.collapse=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){switch(t.label){case 0:return[4,this.isExpanded()];case 1:return t.sent()?[4,this.toggle()]:[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},i.prototype.getTextContent=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){switch(t.label){case 0:return[4,this._content()];case 1:return[2,t.sent().text()]}}))}))},i.prototype.getHarnessLoaderForContent=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){return[2,this.locatorFactory.harnessLoaderFor(r)]}))}))},i.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._header()];case 1:return[2,t.sent().focus()]}}))}))},i.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._header()];case 1:return[2,t.sent().blur()]}}))}))},i.prototype.hasToggleIndicator=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){switch(t.label){case 0:return[4,this._expansionIndicator()];case 1:return[2,null!==t.sent()]}}))}))},i.prototype.getToggleIndicatorPosition=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){switch(t.label){case 0:return[4,this._header()];case 1:return[4,t.sent().hasClass("mat-expansion-toggle-indicator-before")];case 2:return t.sent()?[2,"before"]:[2,"after"]}}))}))},i.hostSelector=".mat-expansion-panel",i}(n.ComponentHarness),o=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(r,t),r.with=function(t){return void 0===t&&(t={}),new n.HarnessPredicate(r,t)},r.prototype.getExpansionPanels=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(i.with(t))()]}))}))},r.prototype.isMulti=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().hasClass("mat-accordion-multi")]}}))}))},r.hostSelector=".mat-accordion",r}(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
*/
t.MatAccordionHarness=o,t.MatExpansionPanelHarness=i,Object.defineProperty(t,"__esModule",{value:!0})}));