@@ -14,15 +14,22 @@ import {MatDrawer, MatSidenavModule, MatDrawerContainer} from './index';
14
14
import { Direction } from '@angular/cdk/bidi' ;
15
15
import { A11yModule } from '@angular/cdk/a11y' ;
16
16
import { ESCAPE } from '@angular/cdk/keycodes' ;
17
- import { dispatchKeyboardEvent , createKeyboardEvent , dispatchEvent } from '../../cdk/testing/private' ;
17
+ import {
18
+ dispatchKeyboardEvent ,
19
+ createKeyboardEvent ,
20
+ dispatchEvent ,
21
+ } from '@angular/cdk/testing/private' ;
18
22
import { CdkScrollable } from '@angular/cdk/scrolling' ;
19
23
import { CommonModule } from '@angular/common' ;
20
24
21
25
describe ( 'MatDrawer' , ( ) => {
22
26
beforeEach ( waitForAsync ( ( ) => {
23
27
TestBed . configureTestingModule ( {
24
- imports : [ MatSidenavModule , A11yModule , NoopAnimationsModule , CommonModule ] ,
25
- declarations : [
28
+ imports : [
29
+ MatSidenavModule ,
30
+ A11yModule ,
31
+ NoopAnimationsModule ,
32
+ CommonModule ,
26
33
BasicTestApp ,
27
34
DrawerContainerNoDrawerTestApp ,
28
35
DrawerSetToOpenedFalse ,
@@ -500,8 +507,7 @@ describe('MatDrawer', () => {
500
507
it ( 'should not throw when a two-way binding is toggled quickly while animating' , fakeAsync ( ( ) => {
501
508
TestBed . resetTestingModule ( )
502
509
. configureTestingModule ( {
503
- imports : [ MatSidenavModule , BrowserAnimationsModule ] ,
504
- declarations : [ DrawerOpenBinding ] ,
510
+ imports : [ MatSidenavModule , BrowserAnimationsModule , DrawerOpenBinding ] ,
505
511
} )
506
512
. compileComponents ( ) ;
507
513
@@ -830,8 +836,10 @@ describe('MatDrawer', () => {
830
836
describe ( 'MatDrawerContainer' , ( ) => {
831
837
beforeEach ( waitForAsync ( ( ) => {
832
838
TestBed . configureTestingModule ( {
833
- imports : [ MatSidenavModule , A11yModule , NoopAnimationsModule ] ,
834
- declarations : [
839
+ imports : [
840
+ MatSidenavModule ,
841
+ A11yModule ,
842
+ NoopAnimationsModule ,
835
843
DrawerContainerTwoDrawerTestApp ,
836
844
DrawerDelayed ,
837
845
DrawerSetToOpenedTrue ,
@@ -953,8 +961,7 @@ describe('MatDrawerContainer', () => {
953
961
it ( 'should not animate when the sidenav is open on load' , fakeAsync ( ( ) => {
954
962
TestBed . resetTestingModule ( )
955
963
. configureTestingModule ( {
956
- imports : [ MatSidenavModule , BrowserAnimationsModule ] ,
957
- declarations : [ DrawerSetToOpenedTrue ] ,
964
+ imports : [ MatSidenavModule , BrowserAnimationsModule , DrawerSetToOpenedTrue ] ,
958
965
} )
959
966
. compileComponents ( ) ;
960
967
@@ -1135,7 +1142,11 @@ describe('MatDrawerContainer', () => {
1135
1142
} ) ;
1136
1143
1137
1144
/** Test component that contains an MatDrawerContainer but no MatDrawer. */
1138
- @Component ( { template : `<mat-drawer-container></mat-drawer-container>` } )
1145
+ @Component ( {
1146
+ template : `<mat-drawer-container></mat-drawer-container>` ,
1147
+ standalone : true ,
1148
+ imports : [ MatSidenavModule , A11yModule , CommonModule ] ,
1149
+ } )
1139
1150
class DrawerContainerNoDrawerTestApp { }
1140
1151
1141
1152
/** Test component that contains an MatDrawerContainer and 2 MatDrawer in the same position. */
@@ -1145,6 +1156,8 @@ class DrawerContainerNoDrawerTestApp {}
1145
1156
<mat-drawer position="start"></mat-drawer>
1146
1157
<mat-drawer position="end"></mat-drawer>
1147
1158
</mat-drawer-container>` ,
1159
+ standalone : true ,
1160
+ imports : [ MatSidenavModule , A11yModule ] ,
1148
1161
} )
1149
1162
class DrawerContainerTwoDrawerTestApp {
1150
1163
@ViewChild ( MatDrawerContainer ) drawerContainer : MatDrawerContainer ;
@@ -1172,6 +1185,8 @@ class DrawerContainerTwoDrawerTestApp {
1172
1185
<circle cx="50" cy="50" r="50"/>
1173
1186
</svg>
1174
1187
</mat-drawer-container>` ,
1188
+ standalone : true ,
1189
+ imports : [ MatSidenavModule , A11yModule , CommonModule ] ,
1175
1190
} )
1176
1191
class BasicTestApp {
1177
1192
openCount = 0 ;
@@ -1216,6 +1231,8 @@ class BasicTestApp {
1216
1231
Closed Drawer.
1217
1232
</mat-drawer>
1218
1233
</mat-drawer-container>` ,
1234
+ standalone : true ,
1235
+ imports : [ MatSidenavModule , A11yModule , CommonModule ] ,
1219
1236
} )
1220
1237
class DrawerSetToOpenedFalse { }
1221
1238
@@ -1226,6 +1243,8 @@ class DrawerSetToOpenedFalse {}
1226
1243
Closed Drawer.
1227
1244
</mat-drawer>
1228
1245
</mat-drawer-container>` ,
1246
+ standalone : true ,
1247
+ imports : [ MatSidenavModule , A11yModule , CommonModule ] ,
1229
1248
} )
1230
1249
class DrawerSetToOpenedTrue {
1231
1250
openCallback = jasmine . createSpy ( 'open callback' ) ;
@@ -1238,6 +1257,8 @@ class DrawerSetToOpenedTrue {
1238
1257
Closed Drawer.
1239
1258
</mat-drawer>
1240
1259
</mat-drawer-container>` ,
1260
+ standalone : true ,
1261
+ imports : [ MatSidenavModule , A11yModule , CommonModule ] ,
1241
1262
} )
1242
1263
class DrawerOpenBinding {
1243
1264
isOpen = false ;
@@ -1249,6 +1270,8 @@ class DrawerOpenBinding {
1249
1270
<mat-drawer #drawer1 [position]="drawer1Position"></mat-drawer>
1250
1271
<mat-drawer #drawer2 [position]="drawer2Position"></mat-drawer>
1251
1272
</mat-drawer-container>` ,
1273
+ standalone : true ,
1274
+ imports : [ MatSidenavModule , A11yModule , CommonModule ] ,
1252
1275
} )
1253
1276
class DrawerDynamicPosition {
1254
1277
drawer1Position = 'start' ;
@@ -1265,6 +1288,8 @@ class DrawerDynamicPosition {
1265
1288
</mat-drawer>
1266
1289
<input type="text" class="input2"/>
1267
1290
</mat-drawer-container>` ,
1291
+ standalone : true ,
1292
+ imports : [ MatSidenavModule , A11yModule , CommonModule ] ,
1268
1293
} )
1269
1294
class DrawerWithFocusableElements {
1270
1295
mode : string = 'over' ;
@@ -1278,6 +1303,8 @@ class DrawerWithFocusableElements {
1278
1303
<button disabled>Not focusable</button>
1279
1304
</mat-drawer>
1280
1305
</mat-drawer-container>` ,
1306
+ standalone : true ,
1307
+ imports : [ MatSidenavModule , A11yModule , CommonModule ] ,
1281
1308
} )
1282
1309
class DrawerWithoutFocusableElements { }
1283
1310
@@ -1289,6 +1316,8 @@ class DrawerWithoutFocusableElements {}
1289
1316
}
1290
1317
</mat-drawer-container>
1291
1318
` ,
1319
+ standalone : true ,
1320
+ imports : [ MatSidenavModule , A11yModule ] ,
1292
1321
} )
1293
1322
class DrawerDelayed {
1294
1323
@ViewChild ( MatDrawer ) drawer : MatDrawer ;
@@ -1302,6 +1331,8 @@ class DrawerDelayed {
1302
1331
<mat-drawer [mode]="mode" style="width:100px"></mat-drawer>
1303
1332
}
1304
1333
</mat-drawer-container>` ,
1334
+ standalone : true ,
1335
+ imports : [ MatSidenavModule , A11yModule ] ,
1305
1336
} )
1306
1337
class DrawerContainerStateChangesTestApp {
1307
1338
@ViewChild ( MatDrawer ) drawer : MatDrawer ;
@@ -1320,6 +1351,8 @@ class DrawerContainerStateChangesTestApp {
1320
1351
<div [style.width.px]="fillerWidth" style="height: 200px; background: red;"></div>
1321
1352
</mat-drawer>
1322
1353
</mat-drawer-container>` ,
1354
+ standalone : true ,
1355
+ imports : [ MatSidenavModule , A11yModule ] ,
1323
1356
} )
1324
1357
class AutosizeDrawer {
1325
1358
@ViewChild ( MatDrawer ) drawer : MatDrawer ;
@@ -1334,6 +1367,8 @@ class AutosizeDrawer {
1334
1367
<mat-drawer-content>Content</mat-drawer-content>
1335
1368
</mat-drawer-container>
1336
1369
` ,
1370
+ standalone : true ,
1371
+ imports : [ MatSidenavModule , A11yModule ] ,
1337
1372
} )
1338
1373
class DrawerContainerWithContent {
1339
1374
@ViewChild ( MatDrawerContainer ) drawerContainer : MatDrawerContainer ;
@@ -1348,6 +1383,8 @@ class DrawerContainerWithContent {
1348
1383
<mat-drawer #drawer>Drawer</mat-drawer>
1349
1384
}
1350
1385
</mat-drawer-container>` ,
1386
+ standalone : true ,
1387
+ imports : [ MatSidenavModule , A11yModule , CommonModule ] ,
1351
1388
} )
1352
1389
class IndirectDescendantDrawer {
1353
1390
@ViewChild ( 'container' ) container : MatDrawerContainer ;
@@ -1365,6 +1402,8 @@ class IndirectDescendantDrawer {
1365
1402
</mat-drawer-content>
1366
1403
</mat-drawer-container>
1367
1404
` ,
1405
+ standalone : true ,
1406
+ imports : [ MatSidenavModule , A11yModule , CommonModule ] ,
1368
1407
} )
1369
1408
class NestedDrawerContainers {
1370
1409
@ViewChild ( 'outerContainer' ) outerContainer : MatDrawerContainer ;
0 commit comments