@angular/material
Version:
Angular Material
1 lines • 2.47 kB
Source Map (JSON)
{"version":3,"file":"progress-bar-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/progress-bar/testing/progress-bar-harness.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.dev/license\n */\n\nimport {coerceNumberProperty} from '@angular/cdk/coercion';\nimport {\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing';\nimport {ProgressBarHarnessFilters} from './progress-bar-harness-filters';\n\n/** Harness for interacting with a `mat-progress-bar` in tests. */\nexport class MatProgressBarHarness extends ComponentHarness {\n static hostSelector = '.mat-mdc-progress-bar';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a progress bar with specific\n * attributes.\n * @param options Options for filtering which progress bar instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatProgressBarHarness>(\n this: ComponentHarnessConstructor<T>,\n options: ProgressBarHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options);\n }\n\n /** Gets a promise for the progress bar's value. */\n async getValue(): Promise<number | null> {\n const host = await this.host();\n const ariaValue = await host.getAttribute('aria-valuenow');\n return ariaValue ? coerceNumberProperty(ariaValue) : null;\n }\n\n /** Gets a promise for the progress bar's mode. */\n async getMode(): Promise<string | null> {\n return (await this.host()).getAttribute('mode');\n }\n}\n"],"names":["MatProgressBarHarness","ComponentHarness","hostSelector","with","options","HarnessPredicate","getValue","host","ariaValue","getAttribute","coerceNumberProperty","getMode"],"mappings":";;;AAiBM,MAAOA,qBAAsB,SAAQC,gBAAgB,CAAA;EACzD,OAAOC,YAAY,GAAG,uBAAuB;AAQ7C,EAAA,OAAOC,IAAIA,CAETC,OAAA,GAAqC,EAAE,EAAA;AAEvC,IAAA,OAAO,IAAIC,gBAAgB,CAAC,IAAI,EAAED,OAAO,CAAC;AAC5C;EAGA,MAAME,QAAQA,GAAA;AACZ,IAAA,MAAMC,IAAI,GAAG,MAAM,IAAI,CAACA,IAAI,EAAE;IAC9B,MAAMC,SAAS,GAAG,MAAMD,IAAI,CAACE,YAAY,CAAC,eAAe,CAAC;AAC1D,IAAA,OAAOD,SAAS,GAAGE,oBAAoB,CAACF,SAAS,CAAC,GAAG,IAAI;AAC3D;EAGA,MAAMG,OAAOA,GAAA;IACX,OAAO,CAAC,MAAM,IAAI,CAACJ,IAAI,EAAE,EAAEE,YAAY,CAAC,MAAM,CAAC;AACjD;;;;;"}