@@ -327,8 +327,8 @@ describe('MatMenu', () => {
327
327
describe ( 'lazy rendering' , ( ) => {
328
328
it ( 'should be able to render the menu content lazily' , fakeAsync ( ( ) => {
329
329
const fixture = TestBed . createComponent ( SimpleLazyMenu ) ;
330
-
331
330
fixture . detectChanges ( ) ;
331
+
332
332
fixture . componentInstance . triggerEl . nativeElement . click ( ) ;
333
333
fixture . detectChanges ( ) ;
334
334
tick ( 500 ) ;
@@ -340,24 +340,6 @@ describe('MatMenu', () => {
340
340
expect ( fixture . componentInstance . trigger . menuOpen ) . toBe ( true , 'Expected menu to be open' ) ;
341
341
} ) ) ;
342
342
343
- it ( 'should detach the lazy content when the menu is closed' , fakeAsync ( ( ) => {
344
- const fixture = TestBed . createComponent ( SimpleLazyMenu ) ;
345
-
346
- fixture . detectChanges ( ) ;
347
- fixture . componentInstance . trigger . openMenu ( ) ;
348
- fixture . detectChanges ( ) ;
349
- tick ( 500 ) ;
350
-
351
- expect ( fixture . componentInstance . items . length ) . toBeGreaterThan ( 0 ) ;
352
-
353
- fixture . componentInstance . trigger . closeMenu ( ) ;
354
- fixture . detectChanges ( ) ;
355
- tick ( 500 ) ;
356
- fixture . detectChanges ( ) ;
357
-
358
- expect ( fixture . componentInstance . items . length ) . toBe ( 0 ) ;
359
- } ) ) ;
360
-
361
343
it ( 'should focus the first menu item when opening a lazy menu via keyboard' , fakeAsync ( ( ) => {
362
344
let zone : MockNgZone ;
363
345
@@ -390,8 +372,8 @@ describe('MatMenu', () => {
390
372
391
373
it ( 'should be able to open the same menu with a different context' , fakeAsync ( ( ) => {
392
374
const fixture = TestBed . createComponent ( LazyMenuWithContext ) ;
393
-
394
375
fixture . detectChanges ( ) ;
376
+
395
377
fixture . componentInstance . triggerOne . openMenu ( ) ;
396
378
fixture . detectChanges ( ) ;
397
379
tick ( 500 ) ;
@@ -1575,7 +1557,6 @@ class FakeIcon {}
1575
1557
class SimpleLazyMenu {
1576
1558
@ViewChild ( MatMenuTrigger ) trigger : MatMenuTrigger ;
1577
1559
@ViewChild ( 'triggerEl' ) triggerEl : ElementRef ;
1578
- @ViewChildren ( MatMenuItem ) items : QueryList < MatMenuItem > ;
1579
1560
}
1580
1561
1581
1562
0 commit comments