Skip to content

Commit

Permalink
test: fix overzealous calls to markForCheck from #29083 (#29131)
Browse files Browse the repository at this point in the history
(cherry picked from commit 32c5308)
  • Loading branch information
mmalerba committed May 29, 2024
1 parent 3d13876 commit 6281fe6
Show file tree
Hide file tree
Showing 11 changed files with 208 additions and 817 deletions.
4 changes: 0 additions & 4 deletions src/cdk/a11y/live-announcer/live-announcer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ describe('LiveAnnouncer', () => {
const overlayRef = overlay.create();
const componentRef = overlayRef.attach(portal);
const modal = componentRef.location.nativeElement;
fixture.changeDetectorRef.markForCheck();
fixture.detectChanges();

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

componentRef.instance.ariaOwns = 'foo bar';
Expand Down Expand Up @@ -320,7 +318,6 @@ describe('CdkAriaLive', () => {
announcer = la;
announcerSpy = spyOn(la, 'announce').and.callThrough();
fixture = TestBed.createComponent(DivWithCdkAriaLive);
fixture.changeDetectorRef.markForCheck();
fixture.detectChanges();
flush();
}),
Expand Down Expand Up @@ -375,7 +372,6 @@ describe('CdkAriaLive', () => {

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

fixture.changeDetectorRef.markForCheck();
fixture.detectChanges();
invokeMutationCallbacks();
flush();
Expand Down
4 changes: 0 additions & 4 deletions src/cdk/clipboard/copy-to-clipboard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ describe('CdkCopyToClipboard', () => {
fixture.detectChanges();

fixture.nativeElement.querySelector('button')!.click();
fixture.changeDetectorRef.markForCheck();
fixture.detectChanges();
tick(3);

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

fixture.nativeElement.querySelector('button')!.click();
fixture.changeDetectorRef.markForCheck();
fixture.detectChanges();
tick(3);

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

spyOn(clipboard, 'beginCopy').and.returnValue(fakeCopy);
fixture.changeDetectorRef.markForCheck();
fixture.detectChanges();

fixture.nativeElement.querySelector('button')!.click();
fixture.changeDetectorRef.markForCheck();
fixture.detectChanges();
tick(1);

Expand Down
Loading

0 comments on commit 6281fe6

Please sign in to comment.