@@ -622,6 +622,23 @@ describe('MDC-based MatTabGroup', () => {
622
622
jasmine . objectContaining ( { index : 1 } ) ,
623
623
) ;
624
624
} ) ) ;
625
+
626
+ it ( 'should be able to disable the pagination' , fakeAsync ( ( ) => {
627
+ fixture . componentInstance . disablePagination = true ;
628
+ fixture . detectChanges ( ) ;
629
+ tick ( ) ;
630
+
631
+ for ( let i = 0 ; i < 50 ; i ++ ) {
632
+ fixture . componentInstance . tabs . push ( { label : `Extra ${ i } ` , content : '' } ) ;
633
+ }
634
+
635
+ fixture . detectChanges ( ) ;
636
+ tick ( ) ;
637
+
638
+ expect (
639
+ fixture . nativeElement . querySelector ( '.mat-mdc-tab-header-pagination-controls-enabled' ) ,
640
+ ) . toBeFalsy ( ) ;
641
+ } ) ) ;
625
642
} ) ;
626
643
627
644
describe ( 'async tabs' , ( ) => {
@@ -1111,7 +1128,8 @@ class SimpleTabsTestApp {
1111
1128
<mat-tab-group class="tab-group"
1112
1129
[(selectedIndex)]="selectedIndex"
1113
1130
(focusChange)="handleFocus($event)"
1114
- (selectedTabChange)="handleSelection($event)">
1131
+ (selectedTabChange)="handleSelection($event)"
1132
+ [disablePagination]="disablePagination">
1115
1133
<mat-tab *ngFor="let tab of tabs">
1116
1134
<ng-template mat-tab-label>{{tab.label}}</ng-template>
1117
1135
{{tab.content}}
@@ -1128,6 +1146,7 @@ class SimpleDynamicTabsTestApp {
1128
1146
selectedIndex : number = 1 ;
1129
1147
focusEvent : any ;
1130
1148
selectEvent : any ;
1149
+ disablePagination = false ;
1131
1150
handleFocus ( event : any ) {
1132
1151
this . focusEvent = event ;
1133
1152
}
0 commit comments