source: trip-planner-front/node_modules/@angular/material/fesm2015/tabs/testing.js.map

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 15.1 KB
Line 
1{"version":3,"file":"tabs__testing.js","sources":["../../../../../../src/material/tabs/testing/tab-harness.ts","../../../../../../src/material/tabs/testing/tab-group-harness.ts","../../../../../../src/material/tabs/testing/tab-link-harness.ts","../../../../../../src/material/tabs/testing/tab-nav-bar-harness.ts","../../../../../../src/material/tabs/testing/public-api.ts","../../../../../../src/material/tabs/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 {\n ContentContainerComponentHarness,\n HarnessLoader,\n HarnessPredicate,\n} from '@angular/cdk/testing';\nimport {TabHarnessFilters} from './tab-harness-filters';\n\n/** Harness for interacting with a standard Angular Material tab-label in tests. */\nexport class MatTabHarness extends ContentContainerComponentHarness<string> {\n /** The selector for the host element of a `MatTab` instance. */\n static hostSelector = '.mat-tab-label';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatTabHarness` that meets\n * certain criteria.\n * @param options Options for filtering which tab instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: TabHarnessFilters = {}): HarnessPredicate<MatTabHarness> {\n return new HarnessPredicate(MatTabHarness, options)\n .addOption('label', options.label,\n (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label));\n }\n\n /** Gets the label of the tab. */\n async getLabel(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Gets the aria-label of the tab. */\n async getAriaLabel(): Promise<string|null> {\n return (await this.host()).getAttribute('aria-label');\n }\n\n /** Gets the value of the \"aria-labelledby\" attribute. */\n async getAriaLabelledby(): Promise<string|null> {\n return (await this.host()).getAttribute('aria-labelledby');\n }\n\n /** Whether the tab is selected. */\n async isSelected(): Promise<boolean> {\n const hostEl = await this.host();\n return (await hostEl.getAttribute('aria-selected')) === 'true';\n }\n\n /** Whether the tab is disabled. */\n async isDisabled(): Promise<boolean> {\n const hostEl = await this.host();\n return (await hostEl.getAttribute('aria-disabled')) === 'true';\n }\n\n /** Selects the given tab by clicking on the label. Tab cannot be selected if disabled. */\n async select(): Promise<void> {\n await (await this.host()).click();\n }\n\n /** Gets the text content of the tab. */\n async getTextContent(): Promise<string> {\n const contentId = await this._getContentId();\n const contentEl = await this.documentRootLocatorFactory().locatorFor(`#${contentId}`)();\n return contentEl.text();\n }\n\n /**\n * Gets a `HarnessLoader` that can be used to load harnesses for components within the tab's\n * content area.\n * @deprecated Use `getHarness` or `getChildLoader` instead.\n * @breaking-change 12.0.0\n */\n async getHarnessLoaderForContent(): Promise<HarnessLoader> {\n return this.getRootHarnessLoader();\n }\n\n protected override async getRootHarnessLoader(): Promise<HarnessLoader> {\n const contentId = await this._getContentId();\n return this.documentRootLocatorFactory().harnessLoaderFor(`#${contentId}`);\n }\n\n /** Gets the element id for the content of the current tab. */\n private async _getContentId(): Promise<string> {\n const hostEl = await this.host();\n // Tabs never have an empty \"aria-controls\" attribute.\n return (await hostEl.getAttribute('aria-controls'))!;\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 {ComponentHarness, HarnessPredicate, parallel} from '@angular/cdk/testing';\nimport {TabGroupHarnessFilters, TabHarnessFilters} from './tab-harness-filters';\nimport {MatTabHarness} from './tab-harness';\n\n/** Harness for interacting with a standard mat-tab-group in tests. */\nexport class MatTabGroupHarness extends ComponentHarness {\n /** The selector for the host element of a `MatTabGroup` instance. */\n static hostSelector = '.mat-tab-group';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatTabGroupHarness` that meets\n * certain criteria.\n * @param options Options for filtering which tab group instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: TabGroupHarnessFilters = {}): HarnessPredicate<MatTabGroupHarness> {\n return new HarnessPredicate(MatTabGroupHarness, options)\n .addOption('selectedTabLabel', options.selectedTabLabel, async (harness, label) => {\n const selectedTab = await harness.getSelectedTab();\n return HarnessPredicate.stringMatches(await selectedTab.getLabel(), label);\n });\n }\n\n /**\n * Gets the list of tabs in the tab group.\n * @param filter Optionally filters which tabs are included.\n */\n async getTabs(filter: TabHarnessFilters = {}): Promise<MatTabHarness[]> {\n return this.locatorForAll(MatTabHarness.with(filter))();\n }\n\n /** Gets the selected tab of the tab group. */\n async getSelectedTab(): Promise<MatTabHarness> {\n const tabs = await this.getTabs();\n const isSelected = await parallel(() => tabs.map(t => t.isSelected()));\n for (let i = 0; i < tabs.length; i++) {\n if (isSelected[i]) {\n return tabs[i];\n }\n }\n throw new Error('No selected tab could be found.');\n }\n\n /**\n * Selects a tab in this tab group.\n * @param filter An optional filter to apply to the child tabs. The first tab matching the filter\n * will be selected.\n */\n async selectTab(filter: TabHarnessFilters = {}): Promise<void> {\n const tabs = await this.getTabs(filter);\n if (!tabs.length) {\n throw Error(`Cannot find mat-tab matching filter ${JSON.stringify(filter)}`);\n }\n await tabs[0].select();\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 {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {TabLinkHarnessFilters} from './tab-harness-filters';\n\n/** Harness for interacting with a standard Angular Material tab link in tests. */\nexport class MatTabLinkHarness extends ComponentHarness {\n /** The selector for the host element of a `MatTabLink` instance. */\n static hostSelector = '.mat-tab-link';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatTabLinkHarness` that meets\n * certain criteria.\n * @param options Options for filtering which tab link instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: TabLinkHarnessFilters = {}): HarnessPredicate<MatTabLinkHarness> {\n return new HarnessPredicate(MatTabLinkHarness, options)\n .addOption('label', options.label,\n (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label));\n }\n\n /** Gets the label of the link. */\n async getLabel(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Whether the link is active. */\n async isActive(): Promise<boolean> {\n const host = await this.host();\n return host.hasClass('mat-tab-label-active');\n }\n\n /** Whether the link is disabled. */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n return host.hasClass('mat-tab-disabled');\n }\n\n /** Clicks on the link. */\n async click(): Promise<void> {\n await (await this.host()).click();\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 {ComponentHarness, HarnessPredicate, parallel} from '@angular/cdk/testing';\nimport {TabNavBarHarnessFilters, TabLinkHarnessFilters} from './tab-harness-filters';\nimport {MatTabLinkHarness} from './tab-link-harness';\n\n/** Harness for interacting with a standard mat-tab-nav-bar in tests. */\nexport class MatTabNavBarHarness extends ComponentHarness {\n /** The selector for the host element of a `MatTabNavBar` instance. */\n static hostSelector = '.mat-tab-nav-bar';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatTabNavBar` that meets\n * certain criteria.\n * @param options Options for filtering which tab nav bar instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: TabNavBarHarnessFilters = {}): HarnessPredicate<MatTabNavBarHarness> {\n return new HarnessPredicate(MatTabNavBarHarness, options);\n }\n\n /**\n * Gets the list of links in the nav bar.\n * @param filter Optionally filters which links are included.\n */\n async getLinks(filter: TabLinkHarnessFilters = {}): Promise<MatTabLinkHarness[]> {\n return this.locatorForAll(MatTabLinkHarness.with(filter))();\n }\n\n /** Gets the active link in the nav bar. */\n async getActiveLink(): Promise<MatTabLinkHarness> {\n const links = await this.getLinks();\n const isActive = await parallel(() => links.map(t => t.isActive()));\n for (let i = 0; i < links.length; i++) {\n if (isActive[i]) {\n return links[i];\n }\n }\n throw new Error('No active link could be found.');\n }\n\n /**\n * Clicks a link inside the nav bar.\n * @param filter An optional filter to apply to the child link. The first link matching the filter\n * will be clicked.\n */\n async clickLink(filter: TabLinkHarnessFilters = {}): Promise<void> {\n const tabs = await this.getLinks(filter);\n if (!tabs.length) {\n throw Error(`Cannot find mat-tab-link matching filter ${JSON.stringify(filter)}`);\n }\n await tabs[0].click();\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\nexport * from './tab-group-harness';\nexport * from './tab-harness';\nexport * from './tab-harness-filters';\nexport * from './tab-nav-bar-harness';\nexport * from './tab-link-harness';\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;;;;;;;AAeA;MACa,aAAc,SAAQ,gCAAwC;;;;;;;IAUzE,OAAO,IAAI,CAAC,UAA6B,EAAE;QACzC,OAAO,IAAI,gBAAgB,CAAC,aAAa,EAAE,OAAO,CAAC;aAC9C,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAC7B,CAAC,OAAO,EAAE,KAAK,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;KACxF;;IAGK,QAAQ;;YACZ,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC;SACnC;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,UAAU;;YACd,MAA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