blob: 5a20bb2bdac3824376f87befd207ffa4022e0edc [file] [log] [blame]
{"version":3,"file":"dialog__testing.js","sources":["../../../../../../src/material/dialog/testing/dialog-harness.ts","../../../../../../src/material/dialog/testing/dialog-harness-filters.ts","../../../../../../src/material/dialog/testing/public-api.ts","../../../../../../src/material/dialog/testing/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ContentContainerComponentHarness, HarnessPredicate, TestKey} from '@angular/cdk/testing';\nimport {DialogRole} from '@angular/material/dialog';\nimport {DialogHarnessFilters} from './dialog-harness-filters';\n\n/** Harness for interacting with a standard `MatDialog` in tests. */\nexport class MatDialogHarness extends ContentContainerComponentHarness<string> {\n // Developers can provide a custom component or template for the\n // dialog. The canonical dialog parent is the \"MatDialogContainer\".\n /** The selector for the host element of a `MatDialog` instance. */\n static hostSelector = '.mat-dialog-container';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatDialogHarness` that meets\n * certain criteria.\n * @param options Options for filtering which dialog instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: DialogHarnessFilters = {}): HarnessPredicate<MatDialogHarness> {\n return new HarnessPredicate(MatDialogHarness, options);\n }\n\n /** Gets the id of the dialog. */\n async getId(): Promise<string|null> {\n const id = await (await this.host()).getAttribute('id');\n // In case no id has been specified, the \"id\" property always returns\n // an empty string. To make this method more explicit, we return null.\n return id !== '' ? id : null;\n }\n\n /** Gets the role of the dialog. */\n async getRole(): Promise<DialogRole|null> {\n return (await this.host()).getAttribute('role') as Promise<DialogRole|null>;\n }\n\n /** Gets the value of the dialog's \"aria-label\" attribute. */\n async getAriaLabel(): Promise<string|null> {\n return (await this.host()).getAttribute('aria-label');\n }\n\n /** Gets the value of the dialog's \"aria-labelledby\" attribute. */\n async getAriaLabelledby(): Promise<string|null> {\n return (await this.host()).getAttribute('aria-labelledby');\n }\n\n /** Gets the value of the dialog's \"aria-describedby\" attribute. */\n async getAriaDescribedby(): Promise<string|null> {\n return (await this.host()).getAttribute('aria-describedby');\n }\n\n /**\n * Closes the dialog by pressing escape.\n *\n * Note: this method does nothing if `disableClose` has been set to `true` for the dialog.\n */\n async close(): Promise<void> {\n await (await this.host()).sendKeys(TestKey.ESCAPE);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BaseHarnessFilters} from '@angular/cdk/testing';\n\n/** A set of criteria that can be used to filter a list of `MatDialogHarness` instances. */\nexport interface DialogHarnessFilters extends BaseHarnessFilters {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './dialog-harness';\nexport * from './dialog-harness-filters';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA;;;;;;;AAYA;AACA,MAAa,gBAAiB,SAAQ,gCAAwC;;;;;;;IAY5E,OAAO,IAAI,CAAC,UAAgC,EAAE;QAC5C,OAAO,IAAI,gBAAgB,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;KACxD;;IAGK,KAAK;;YACT,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;;;YAGxD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;SAC9B;KAAA;;IAGK,OAAO;;YACX,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,MAAM,CAA6B,CAAC;SAC7E;KAAA;;IAGK,YAAY;;YAChB,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;SACvD;KAAA;;IAGK,iBAAiB;;YACrB,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,iBAAiB,CAAC,CAAC;SAC5D;KAAA;;IAGK,kBAAkB;;YACtB,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,kBAAkB,CAAC,CAAC;SAC7D;KAAA;;;;;;IAOK,KAAK;;YACT,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;SACpD;KAAA;;;;;AA/CM,6BAAY,GAAG,uBAAuB,CAAC;;ACjBhD;;;;;;GAMG;;ACNH;;;;;;GAMG;;ACNH;;;;;;GAMG;;;;"}