@angular/material
Version:
Angular Material
37 lines (35 loc) • 5.2 kB
JavaScript
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/cdk/testing"),require("@angular/cdk/coercion")):"function"==typeof define&&define.amd?define("@angular/material/button/testing",["exports","@angular/cdk/testing","@angular/cdk/coercion"],n):n(((t=t||self).ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.button=t.ng.material.button||{},t.ng.material.button.testing={}),t.ng.cdk.testing,t.ng.cdk.coercion)}(this,(function(t,n,e){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)};function o(t,n,e,r){return new(e||(e=Promise))((function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function c(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new e((function(n){n(t.value)})).then(u,c)}a((r=r.apply(t,n||[])).next())}))}function i(t,n){var e,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function a(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=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 u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=n.call(t,u)}catch(t){i=[6,t],r=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}
/**
* @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=function(t){function u(){return null!==t&&t.apply(this,arguments)||this}return function c(t,n){function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}(u,t),u.with=function(t){return void 0===t&&(t={}),new n.HarnessPredicate(u,t).addOption("text",t.text,(function(t,e){return n.HarnessPredicate.stringMatches(t.getText(),e)}))},u.prototype.click=function(){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.host()];case 1:return[2,t.sent().click()]}}))}))},u.prototype.isDisabled=function(){return o(this,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,this.host()];case 1:return t=r.sent().getAttribute("disabled"),n=e.coerceBooleanProperty,[4,t];case 2:return[2,n.apply(void 0,[r.sent()])]}}))}))},u.prototype.getText=function(){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.host()];case 1:return[2,t.sent().text()]}}))}))},u.prototype.focus=function(){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.host()];case 1:return[2,t.sent().focus()]}}))}))},u.prototype.blur=function(){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.host()];case 1:return[2,t.sent().blur()]}}))}))},u.hostSelector=["[mat-button]","[mat-raised-button]","[mat-flat-button]","[mat-icon-button]","[mat-stroked-button]","[mat-fab]","[mat-mini-fab]"].join(","),u}(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.MatButtonHarness=u,Object.defineProperty(t,"__esModule",{value:!0})}));