blob: 38095542d8ceda88faab46fb54c487bd4eca2662 [file] [log] [blame]
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/cdk/testing"),require("@angular/core"),require("@angular/material/icon"),require("rxjs")):"function"==typeof define&&define.amd?define("@angular/material/icon/testing",["exports","@angular/cdk/testing","@angular/core","@angular/material/icon","rxjs"],e):e(((t=t||self).ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.icon=t.ng.material.icon||{},t.ng.material.icon.testing={}),t.ng.cdk.testing,t.ng.core,t.ng.material.icon,t.rxjs)}(this,(function(t,e,n,r,o){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function a(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function s(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):function e(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))}function s(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function c(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var c=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(n,t),n.with=function(t){var r=this;return void 0===t&&(t={}),new e.HarnessPredicate(n,t).addOption("type",t.type,(function(t,e){return a(r,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,t.getType()];case 1:return[2,n.sent()===e]}}))}))})).addOption("name",t.name,(function(t,n){return e.HarnessPredicate.stringMatches(t.getName(),n)})).addOption("namespace",t.namespace,(function(t,n){return e.HarnessPredicate.stringMatches(t.getNamespace(),n)}))},n.prototype.getType=function(){return a(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.host()];case 1:return[4,t.sent().getAttribute("data-mat-icon-type")];case 2:return[2,"svg"===t.sent()?0:1]}}))}))},n.prototype.getName=function(){return a(this,void 0,void 0,(function(){var t,e;return s(this,(function(n){switch(n.label){case 0:return[4,this.host()];case 1:return[4,(t=n.sent()).getAttribute("data-mat-icon-name")];case 2:return(e=n.sent())?[2,e]:[4,this.getType()];case 3:return 1===n.sent()?[2,t.text()]:[2,null]}}))}))},n.prototype.getNamespace=function(){return a(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.host()];case 1:return[2,t.sent().getAttribute("data-mat-icon-namespace")]}}))}))},n.prototype.isInline=function(){return a(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.host()];case 1:return[2,t.sent().hasClass("mat-icon-inline")]}}))}))},n}(e.ComponentHarness);c.hostSelector=".mat-icon";
/**
* @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 u,p=function(){function t(){}return t.prototype.addSvgIcon=function(){return this},t.prototype.addSvgIconLiteral=function(){return this},t.prototype.addSvgIconInNamespace=function(){return this},t.prototype.addSvgIconLiteralInNamespace=function(){return this},t.prototype.addSvgIconSet=function(){return this},t.prototype.addSvgIconSetLiteral=function(){return this},t.prototype.addSvgIconSetInNamespace=function(){return this},t.prototype.addSvgIconSetLiteralInNamespace=function(){return this},t.prototype.registerFontClassAlias=function(){return this},t.prototype.classNameForFontAlias=function(t){return t},t.prototype.getDefaultFontSetClass=function(){return"material-icons"},t.prototype.getSvgIconFromUrl=function(){return o.of(this._generateEmptySvg())},t.prototype.getNamedSvgIcon=function(){return o.of(this._generateEmptySvg())},t.prototype.setDefaultFontSetClass=function(){return this},t.prototype.addSvgIconResolver=function(){return this},t.prototype.ngOnDestroy=function(){},t.prototype._generateEmptySvg=function(){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.classList.add("fake-testing-svg"),t.setAttribute("fit",""),t.setAttribute("height","100%"),t.setAttribute("width","100%"),t.setAttribute("preserveAspectRatio","xMidYMid meet"),t.setAttribute("focusable","false"),t},t}();p.decorators=[{type:n.Injectable}],(u=function u(){}).decorators=[{type:n.NgModule,args:[{providers:[{provide:r.MatIconRegistry,useClass:p}]}]}],
/**
* @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.FakeMatIconRegistry=p,t.MatIconHarness=c,t.MatIconTestingModule=u,Object.defineProperty(t,"__esModule",{value:!0})}));