Skip to content

Commit c73cfc3

Browse files
committed
test(material/menu): enable exhaustive checks for all tests
Removes the opt out of exhaustive checks from the menu tests. The issue was only in one test that wasn't set up correctly. (cherry picked from commit 830e39e)
1 parent d120f97 commit c73cfc3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/material/menu/menu.spec.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
Input,
2323
OnDestroy,
2424
Output,
25-
provideCheckNoChangesConfig,
2625
QueryList,
2726
signal,
2827
TemplateRef,
@@ -1744,7 +1743,6 @@ describe('MatMenu', () => {
17441743
direction = 'ltr';
17451744
TestBed.resetTestingModule().configureTestingModule({
17461745
providers: [
1747-
provideCheckNoChangesConfig({exhaustive: false}),
17481746
{
17491747
provide: Directionality,
17501748
useValue: {
@@ -1907,7 +1905,7 @@ describe('MatMenu', () => {
19071905
.withContext('Expected two open menus')
19081906
.toBe(2);
19091907

1910-
items[1].componentInstance.disabled = true;
1908+
fixture.componentInstance.secondItemDisabled = true;
19111909
fixture.changeDetectorRef.markForCheck();
19121910
fixture.detectChanges();
19131911

@@ -1932,7 +1930,7 @@ describe('MatMenu', () => {
19321930

19331931
const item = fixture.debugElement.query(By.directive(MatMenuItem))!;
19341932

1935-
item.componentInstance.disabled = true;
1933+
fixture.componentInstance.firstItemDisabled = true;
19361934
fixture.changeDetectorRef.markForCheck();
19371935
fixture.detectChanges();
19381936

@@ -2728,8 +2726,9 @@ class CustomMenu {
27282726
<button mat-menu-item
27292727
id="level-one-trigger"
27302728
[matMenuTriggerFor]="levelOne"
2729+
[disabled]="firstItemDisabled"
27312730
#levelOneTrigger="matMenuTrigger">One</button>
2732-
<button mat-menu-item>Two</button>
2731+
<button mat-menu-item [disabled]="secondItemDisabled">Two</button>
27332732
@if (showLazy) {
27342733
<button mat-menu-item
27352734
id="lazy-trigger"
@@ -2779,6 +2778,9 @@ class NestedMenu {
27792778
@ViewChild('lazy') lazyMenu: MatMenu;
27802779
@ViewChild('lazyTrigger') lazyTrigger: MatMenuTrigger;
27812780
showLazy = false;
2781+
2782+
firstItemDisabled = false;
2783+
secondItemDisabled = false;
27822784
}
27832785

27842786
@Component({

0 commit comments

Comments
 (0)