|
1 | 1 | import {TAB} from '@angular/cdk/keycodes';
|
2 | 2 | import {Platform} from '@angular/cdk/platform';
|
3 | 3 | import {DOCUMENT} from '@angular/common';
|
4 |
| -import {Component, ViewChild, provideZoneChangeDetection} from '@angular/core'; |
| 4 | +import {Component, ViewChild} from '@angular/core'; |
5 | 5 | import {ComponentFixture, TestBed, fakeAsync, flush, inject, tick} from '@angular/core/testing';
|
6 | 6 | import {By} from '@angular/platform-browser';
|
7 | 7 | import {
|
@@ -34,7 +34,6 @@ describe('FocusMonitor', () => {
|
34 | 34 | TestBed.configureTestingModule({
|
35 | 35 | imports: [A11yModule, PlainButton],
|
36 | 36 | providers: [
|
37 |
| - provideZoneChangeDetection(), |
38 | 37 | {
|
39 | 38 | provide: DOCUMENT,
|
40 | 39 | useFactory: () => {
|
@@ -900,25 +899,6 @@ describe('FocusMonitor input label detection', () => {
|
900 | 899 | }));
|
901 | 900 | });
|
902 | 901 |
|
903 |
| -describe('cdkMonitorFocus with change detection counter', () => { |
904 |
| - beforeEach(() => { |
905 |
| - TestBed.configureTestingModule({ |
906 |
| - imports: [A11yModule, ButtonWithCDCounter], |
907 |
| - providers: [{provide: Platform, useValue: {isBrowser: true}}], |
908 |
| - }).compileComponents(); |
909 |
| - }); |
910 |
| - |
911 |
| - it('should detect changes caused by focus change', async () => { |
912 |
| - const fixture = TestBed.createComponent(ButtonWithCDCounter); |
913 |
| - fixture.autoDetectChanges(); |
914 |
| - const buttonElement = fixture.nativeElement.querySelector('button'); |
915 |
| - buttonElement.focus(); |
916 |
| - await fixture.whenStable(); |
917 |
| - const focusChangeCounter = fixture.nativeElement.querySelector('.focus-change-counter'); |
918 |
| - expect(focusChangeCounter.innerText).toBe('1'); |
919 |
| - }); |
920 |
| -}); |
921 |
| - |
922 | 902 | @Component({
|
923 | 903 | template: `<div class="parent"><button>focus me!</button></div>`,
|
924 | 904 | standalone: true,
|
@@ -981,15 +961,3 @@ class CheckboxWithLabel {}
|
981 | 961 | class ExportedFocusMonitor {
|
982 | 962 | @ViewChild('exportedDir') exportedDirRef: CdkMonitorFocus;
|
983 | 963 | }
|
984 |
| - |
985 |
| -@Component({ |
986 |
| - template: ` |
987 |
| - <button cdkMonitorElementFocus (cdkFocusChange)="focusChangeCount = focusChangeCount + 1"></button> |
988 |
| - <div class="focus-change-counter">{{focusChangeCount}}</div> |
989 |
| - `, |
990 |
| - standalone: true, |
991 |
| - imports: [A11yModule], |
992 |
| -}) |
993 |
| -class ButtonWithCDCounter { |
994 |
| - focusChangeCount = 0; |
995 |
| -} |
0 commit comments