Skip to content

Commit bc967e4

Browse files
committed
test: fix overzealous calls to markForCheck from #29083
1 parent eb22e2e commit bc967e4

File tree

11 files changed

+209
-817
lines changed

11 files changed

+209
-817
lines changed

src/cdk/a11y/live-announcer/live-announcer.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ describe('LiveAnnouncer', () => {
178178
const overlayRef = overlay.create();
179179
const componentRef = overlayRef.attach(portal);
180180
const modal = componentRef.location.nativeElement;
181-
fixture.changeDetectorRef.markForCheck();
182181
fixture.detectChanges();
183182

184183
expect(ariaLiveElement.id).toBeTruthy();
@@ -199,7 +198,6 @@ describe('LiveAnnouncer', () => {
199198
const overlayRef = overlay.create();
200199
const componentRef = overlayRef.attach(portal);
201200
const modal = componentRef.location.nativeElement;
202-
fixture.changeDetectorRef.markForCheck();
203201
fixture.detectChanges();
204202

205203
componentRef.instance.ariaOwns = 'foo bar';
@@ -320,7 +318,6 @@ describe('CdkAriaLive', () => {
320318
announcer = la;
321319
announcerSpy = spyOn(la, 'announce').and.callThrough();
322320
fixture = TestBed.createComponent(DivWithCdkAriaLive);
323-
fixture.changeDetectorRef.markForCheck();
324321
fixture.detectChanges();
325322
flush();
326323
}),
@@ -375,7 +372,6 @@ describe('CdkAriaLive', () => {
375372

376373
expect(announcer.announce).toHaveBeenCalledTimes(1);
377374

378-
fixture.changeDetectorRef.markForCheck();
379375
fixture.detectChanges();
380376
invokeMutationCallbacks();
381377
flush();

src/cdk/clipboard/copy-to-clipboard.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ describe('CdkCopyToClipboard', () => {
7878
fixture.detectChanges();
7979

8080
fixture.nativeElement.querySelector('button')!.click();
81-
fixture.changeDetectorRef.markForCheck();
8281
fixture.detectChanges();
8382
tick(3);
8483

@@ -102,7 +101,6 @@ describe('CdkCopyToClipboard', () => {
102101
fixture.detectChanges();
103102

104103
fixture.nativeElement.querySelector('button')!.click();
105-
fixture.changeDetectorRef.markForCheck();
106104
fixture.detectChanges();
107105
tick(3);
108106

@@ -122,11 +120,9 @@ describe('CdkCopyToClipboard', () => {
122120
fixture.detectChanges();
123121

124122
spyOn(clipboard, 'beginCopy').and.returnValue(fakeCopy);
125-
fixture.changeDetectorRef.markForCheck();
126123
fixture.detectChanges();
127124

128125
fixture.nativeElement.querySelector('button')!.click();
129-
fixture.changeDetectorRef.markForCheck();
130126
fixture.detectChanges();
131127
tick(1);
132128

0 commit comments

Comments
 (0)