1
1
import { LEFT_ARROW , RIGHT_ARROW } from '@angular/cdk/keycodes' ;
2
- import { dispatchFakeEvent , dispatchKeyboardEvent } from '../.. /cdk/testing/private' ;
2
+ import { dispatchFakeEvent , dispatchKeyboardEvent } from '@angular /cdk/testing/private' ;
3
3
import { Component , DebugElement , OnInit , QueryList , ViewChild , ViewChildren } from '@angular/core' ;
4
4
import {
5
5
ComponentFixture ,
@@ -25,8 +25,10 @@ import {
25
25
describe ( 'MDC-based MatTabGroup' , ( ) => {
26
26
beforeEach ( fakeAsync ( ( ) => {
27
27
TestBed . configureTestingModule ( {
28
- imports : [ MatTabsModule , CommonModule , NoopAnimationsModule ] ,
29
- declarations : [
28
+ imports : [
29
+ MatTabsModule ,
30
+ CommonModule ,
31
+ NoopAnimationsModule ,
30
32
SimpleTabsTestApp ,
31
33
SimpleDynamicTabsTestApp ,
32
34
BindedTabsTestApp ,
@@ -996,8 +998,12 @@ describe('MDC-based MatTabGroup', () => {
996
998
describe ( 'nested MatTabGroup with enabled animations' , ( ) => {
997
999
beforeEach ( fakeAsync ( ( ) => {
998
1000
TestBed . configureTestingModule ( {
999
- imports : [ MatTabsModule , BrowserAnimationsModule ] ,
1000
- declarations : [ NestedTabs , TabsWithCustomAnimationDuration ] ,
1001
+ imports : [
1002
+ MatTabsModule ,
1003
+ BrowserAnimationsModule ,
1004
+ NestedTabs ,
1005
+ TabsWithCustomAnimationDuration ,
1006
+ ] ,
1001
1007
} ) ;
1002
1008
1003
1009
TestBed . compileComponents ( ) ;
@@ -1034,8 +1040,7 @@ describe('MatTabGroup with ink bar fit to content', () => {
1034
1040
1035
1041
beforeEach ( fakeAsync ( ( ) => {
1036
1042
TestBed . configureTestingModule ( {
1037
- imports : [ MatTabsModule , BrowserAnimationsModule ] ,
1038
- declarations : [ TabGroupWithInkBarFitToContent ] ,
1043
+ imports : [ MatTabsModule , BrowserAnimationsModule , TabGroupWithInkBarFitToContent ] ,
1039
1044
} ) ;
1040
1045
1041
1046
TestBed . compileComponents ( ) ;
@@ -1077,8 +1082,7 @@ describe('MatTabNavBar with a default config', () => {
1077
1082
1078
1083
beforeEach ( fakeAsync ( ( ) => {
1079
1084
TestBed . configureTestingModule ( {
1080
- imports : [ MatTabsModule , BrowserAnimationsModule ] ,
1081
- declarations : [ SimpleTabsTestApp ] ,
1085
+ imports : [ MatTabsModule , BrowserAnimationsModule , SimpleTabsTestApp ] ,
1082
1086
providers : [
1083
1087
{
1084
1088
provide : MAT_TABS_CONFIG ,
@@ -1132,6 +1136,8 @@ describe('MatTabNavBar with a default config', () => {
1132
1136
</mat-tab>
1133
1137
</mat-tab-group>
1134
1138
` ,
1139
+ standalone : true ,
1140
+ imports : [ MatTabsModule , CommonModule ] ,
1135
1141
} )
1136
1142
class SimpleTabsTestApp {
1137
1143
@ViewChild ( MatTabGroup ) tabGroup : MatTabGroup ;
@@ -1166,6 +1172,8 @@ class SimpleTabsTestApp {
1166
1172
}
1167
1173
</mat-tab-group>
1168
1174
` ,
1175
+ standalone : true ,
1176
+ imports : [ MatTabsModule , CommonModule ] ,
1169
1177
} )
1170
1178
class SimpleDynamicTabsTestApp {
1171
1179
tabs = [
@@ -1193,6 +1201,8 @@ class SimpleDynamicTabsTestApp {
1193
1201
}
1194
1202
</mat-tab-group>
1195
1203
` ,
1204
+ standalone : true ,
1205
+ imports : [ MatTabsModule , CommonModule ] ,
1196
1206
} )
1197
1207
class BindedTabsTestApp {
1198
1208
tabs = [
@@ -1227,6 +1237,8 @@ class BindedTabsTestApp {
1227
1237
</mat-tab>
1228
1238
</mat-tab-group>
1229
1239
` ,
1240
+ standalone : true ,
1241
+ imports : [ MatTabsModule , CommonModule ] ,
1230
1242
} )
1231
1243
class DisabledTabsTestApp {
1232
1244
@ViewChildren ( MatTab ) tabs : QueryList < MatTab > ;
@@ -1244,6 +1256,8 @@ class DisabledTabsTestApp {
1244
1256
}
1245
1257
</mat-tab-group>
1246
1258
` ,
1259
+ standalone : true ,
1260
+ imports : [ MatTabsModule , CommonModule ] ,
1247
1261
} )
1248
1262
class AsyncTabsTestApp implements OnInit {
1249
1263
private _tabs = [
@@ -1270,6 +1284,8 @@ class AsyncTabsTestApp implements OnInit {
1270
1284
<mat-tab label="Legumes"> <p #legumes>Peanuts</p> </mat-tab>
1271
1285
</mat-tab-group>
1272
1286
` ,
1287
+ standalone : true ,
1288
+ imports : [ MatTabsModule , CommonModule ] ,
1273
1289
} )
1274
1290
class TabGroupWithSimpleApi {
1275
1291
preserveContent = false ;
@@ -1291,6 +1307,8 @@ class TabGroupWithSimpleApi {
1291
1307
</mat-tab>
1292
1308
</mat-tab-group>
1293
1309
` ,
1310
+ standalone : true ,
1311
+ imports : [ MatTabsModule , CommonModule ] ,
1294
1312
} )
1295
1313
class NestedTabs {
1296
1314
@ViewChildren ( MatTabGroup ) groups : QueryList < MatTabGroup > ;
@@ -1309,6 +1327,8 @@ class NestedTabs {
1309
1327
</mat-tab>
1310
1328
</mat-tab-group>
1311
1329
` ,
1330
+ standalone : true ,
1331
+ imports : [ MatTabsModule , CommonModule ] ,
1312
1332
} )
1313
1333
class TemplateTabs { }
1314
1334
@@ -1318,6 +1338,8 @@ class TemplateTabs {}
1318
1338
<mat-tab [aria-label]="ariaLabel" [aria-labelledby]="ariaLabelledby"></mat-tab>
1319
1339
</mat-tab-group>
1320
1340
` ,
1341
+ standalone : true ,
1342
+ imports : [ MatTabsModule , CommonModule ] ,
1321
1343
} )
1322
1344
class TabGroupWithAriaInputs {
1323
1345
ariaLabel : string ;
@@ -1335,6 +1357,8 @@ class TabGroupWithAriaInputs {
1335
1357
<div>pizza is active</div>
1336
1358
}
1337
1359
` ,
1360
+ standalone : true ,
1361
+ imports : [ MatTabsModule , CommonModule ] ,
1338
1362
} )
1339
1363
class TabGroupWithIsActiveBinding { }
1340
1364
@@ -1345,6 +1369,8 @@ class TabGroupWithIsActiveBinding {}
1345
1369
<mat-tab label="Two">Tab two content</mat-tab>
1346
1370
</mat-tab-group>
1347
1371
` ,
1372
+ standalone : true ,
1373
+ imports : [ MatTabsModule ] ,
1348
1374
} )
1349
1375
class TabsWithCustomAnimationDuration { }
1350
1376
@@ -1357,6 +1383,8 @@ class TabsWithCustomAnimationDuration {}
1357
1383
}
1358
1384
</mat-tab-group>
1359
1385
` ,
1386
+ standalone : true ,
1387
+ imports : [ MatTabsModule , CommonModule ] ,
1360
1388
} )
1361
1389
class TabGroupWithIndirectDescendantTabs {
1362
1390
@ViewChild ( MatTabGroup ) tabGroup : MatTabGroup ;
@@ -1369,6 +1397,8 @@ class TabGroupWithIndirectDescendantTabs {
1369
1397
<mat-tab label="Two">Tab two content</mat-tab>
1370
1398
</mat-tab-group>
1371
1399
` ,
1400
+ standalone : true ,
1401
+ imports : [ MatTabsModule ] ,
1372
1402
} )
1373
1403
class TabGroupWithInkBarFitToContent {
1374
1404
fitInkBarToContent = true ;
@@ -1390,6 +1420,8 @@ class TabGroupWithInkBarFitToContent {
1390
1420
</ng-container>
1391
1421
</mat-tab-group>
1392
1422
` ,
1423
+ standalone : true ,
1424
+ imports : [ MatTabsModule , CommonModule ] ,
1393
1425
} )
1394
1426
class TabGroupWithSpaceAbove {
1395
1427
@ViewChild ( MatTabGroup ) tabGroup : MatTabGroup ;
@@ -1412,6 +1444,8 @@ class TabGroupWithSpaceAbove {
1412
1444
<mat-tab label="Parent 3">Parent 3</mat-tab>
1413
1445
</mat-tab-group>
1414
1446
` ,
1447
+ standalone : true ,
1448
+ imports : [ MatTabsModule , CommonModule ] ,
1415
1449
} )
1416
1450
class NestedTabGroupWithLabel { }
1417
1451
@@ -1427,6 +1461,8 @@ class NestedTabGroupWithLabel {}
1427
1461
</mat-tab>
1428
1462
</mat-tab-group>
1429
1463
` ,
1464
+ standalone : true ,
1465
+ imports : [ MatTabsModule , CommonModule ] ,
1430
1466
} )
1431
1467
class TabsWithClassesTestApp {
1432
1468
labelClassList ?: string | string [ ] ;
0 commit comments