File tree Expand file tree Collapse file tree 8 files changed +8
-27
lines changed
material-experimental/mdc-tabs/testing
tools/public_api_guard/material Expand file tree Collapse file tree 8 files changed +8
-27
lines changed Original file line number Diff line number Diff line change @@ -33,12 +33,6 @@ export class MatTabLinkHarness extends ComponentHarness {
33
33
return ( await this . host ( ) ) . text ( ) ;
34
34
}
35
35
36
- /** Gets the value of the `aria-controls` attribute. */
37
- async getAriaControls ( ) : Promise < string | null > {
38
- const host = await this . host ( ) ;
39
- return host . getAttribute ( 'aria-controls' ) ;
40
- }
41
-
42
36
/** Whether the link is active. */
43
37
async isActive ( ) : Promise < boolean > {
44
38
const host = await this . host ( ) ;
Original file line number Diff line number Diff line change @@ -66,7 +66,8 @@ export class MatTabNavBarHarness extends ComponentHarness {
66
66
/** Gets the panel associated with the nav bar. */
67
67
async getPanel ( ) : Promise < MatTabNavPanelHarness > {
68
68
const link = await this . getActiveLink ( ) ;
69
- const panelId = await link . getAriaControls ( ) ;
69
+ const host = await link . host ( ) ;
70
+ const panelId = await host . getAttribute ( 'aria-controls' ) ;
70
71
if ( ! panelId ) {
71
72
throw Error ( 'No panel is controlled by the nav bar.' ) ;
72
73
}
Original file line number Diff line number Diff line change 6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
8
9
- import { ComponentHarness , HarnessPredicate } from '@angular/cdk/testing' ;
9
+ import { ContentContainerComponentHarness , HarnessPredicate } from '@angular/cdk/testing' ;
10
10
import { TabNavPanelHarnessFilters } from './tab-harness-filters' ;
11
11
12
12
/** Harness for interacting with a standard mat-tab-nav-panel in tests. */
13
- export class MatTabNavPanelHarness extends ComponentHarness {
13
+ export class MatTabNavPanelHarness extends ContentContainerComponentHarness {
14
14
/** The selector for the host element of a `MatTabNavPanel` instance. */
15
15
static hostSelector = '.mat-mdc-tab-nav-panel' ;
16
16
Original file line number Diff line number Diff line change @@ -33,12 +33,6 @@ export class MatTabLinkHarness extends ComponentHarness {
33
33
return ( await this . host ( ) ) . text ( ) ;
34
34
}
35
35
36
- /** Gets the value of the `aria-controls` attribute. */
37
- async getAriaControls ( ) : Promise < string | null > {
38
- const host = await this . host ( ) ;
39
- return host . getAttribute ( 'aria-controls' ) ;
40
- }
41
-
42
36
/** Whether the link is active. */
43
37
async isActive ( ) : Promise < boolean > {
44
38
const host = await this . host ( ) ;
Original file line number Diff line number Diff line change @@ -66,7 +66,8 @@ export class MatTabNavBarHarness extends ComponentHarness {
66
66
/** Gets the panel associated with the nav bar. */
67
67
async getPanel ( ) : Promise < MatTabNavPanelHarness > {
68
68
const link = await this . getActiveLink ( ) ;
69
- const panelId = await link . getAriaControls ( ) ;
69
+ const host = await link . host ( ) ;
70
+ const panelId = await host . getAttribute ( 'aria-controls' ) ;
70
71
if ( ! panelId ) {
71
72
throw Error ( 'No panel is controlled by the nav bar.' ) ;
72
73
}
Original file line number Diff line number Diff line change @@ -65,14 +65,6 @@ export function runTabNavBarHarnessTests(
65
65
expect ( await links [ 2 ] . getLabel ( ) ) . toBe ( 'Third' ) ;
66
66
} ) ;
67
67
68
- it ( 'should be able to get the `aria-controls` attribute value of link' , async ( ) => {
69
- const navBar = await loader . getHarness ( tabNavBarHarness ) ;
70
- const links = await navBar . getLinks ( ) ;
71
- expect ( await links [ 0 ] . getAriaControls ( ) ) . toBe ( 'tab-panel' ) ;
72
- expect ( await links [ 1 ] . getAriaControls ( ) ) . toBe ( 'tab-panel' ) ;
73
- expect ( await links [ 2 ] . getAriaControls ( ) ) . toBe ( 'tab-panel' ) ;
74
- } ) ;
75
-
76
68
it ( 'should be able to get disabled state of link' , async ( ) => {
77
69
const navBar = await loader . getHarness ( tabNavBarHarness ) ;
78
70
const links = await navBar . getLinks ( ) ;
Original file line number Diff line number Diff line change 6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
8
9
- import { ComponentHarness , HarnessPredicate } from '@angular/cdk/testing' ;
9
+ import { ContentContainerComponentHarness , HarnessPredicate } from '@angular/cdk/testing' ;
10
10
import { TabNavPanelHarnessFilters } from './tab-harness-filters' ;
11
11
12
12
/** Harness for interacting with a standard mat-tab-nav-panel in tests. */
13
- export class MatTabNavPanelHarness extends ComponentHarness {
13
+ export class MatTabNavPanelHarness extends ContentContainerComponentHarness {
14
14
/** The selector for the host element of a `MatTabNavPanel` instance. */
15
15
static hostSelector = '.mat-tab-nav-panel' ;
16
16
Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ export class MatTabHarness extends ContentContainerComponentHarness<string> {
37
37
// @public
38
38
export class MatTabLinkHarness extends ComponentHarness {
39
39
click(): Promise <void >;
40
- getAriaControls(): Promise <string | null >;
41
40
getLabel(): Promise <string >;
42
41
static hostSelector: string ;
43
42
isActive(): Promise <boolean >;
You can’t perform that action at this time.
0 commit comments