!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/snack-bar/testing",["exports","tslib","@angular/cdk/testing"],e):e(((t=t||self).ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.snackBar=t.ng.material.snackBar||{},t.ng.material.snackBar.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=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e._simpleSnackBar=e.locatorForOptional(".mat-simple-snackbar"),e._simpleSnackBarMessage=e.locatorFor(".mat-simple-snackbar > span"),e._simpleSnackBarActionButton=e.locatorForOptional(".mat-simple-snackbar-action > button"),e}return e.__extends(r,t),r.with=function(t){return void 0===t&&(t={}),new n.HarnessPredicate(r,t)},r.prototype.getRole=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("role")]}}))}))},r.prototype.hasAction=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){switch(t.label){case 0:return[4,this._assertSimpleSnackBar()];case 1:return t.sent(),[4,this._simpleSnackBarActionButton()];case 2:return[2,null!==t.sent()]}}))}))},r.prototype.getActionDescription=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){switch(t.label){case 0:return[4,this._assertSimpleSnackBarWithAction()];case 1:return t.sent(),[4,this._simpleSnackBarActionButton()];case 2:return[2,t.sent().text()]}}))}))},r.prototype.dismissWithAction=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){switch(t.label){case 0:return[4,this._assertSimpleSnackBarWithAction()];case 1:return t.sent(),[4,this._simpleSnackBarActionButton()];case 2:return[4,t.sent().click()];case 3:return t.sent(),[2]}}))}))},r.prototype.getMessage=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){switch(t.label){case 0:return[4,this._assertSimpleSnackBar()];case 1:return t.sent(),[4,this._simpleSnackBarMessage()];case 2:return[2,t.sent().text()]}}))}))},r.prototype._assertSimpleSnackBar=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){switch(t.label){case 0:return[4,this._isSimpleSnackBar()];case 1:if(!t.sent())throw new Error("Method cannot be used for snack-bar with custom content.");return[2]}}))}))},r.prototype._assertSimpleSnackBarWithAction=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){switch(t.label){case 0:return[4,this._assertSimpleSnackBar()];case 1:return t.sent(),[4,this.hasAction()];case 2:if(!t.sent())throw new Error("Method cannot be used for standard snack-bar without action.");return[2]}}))}))},r.prototype._isSimpleSnackBar=function(){return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(t){switch(t.label){case 0:return[4,this._simpleSnackBar()];case 1:return[2,null!==t.sent()]}}))}))},r.hostSelector=".mat-snack-bar-container",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.MatSnackBarHarness=r,Object.defineProperty(t,"__esModule",{value:!0})}));