Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cdk/drag-drop/directives/drop-list-shared.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2733,7 +2733,7 @@ export function defineCommonDropListTests(config: {
startDraggingViaMouse(fixture, item);
dispatchMouseEvent(document, 'mousemove', listRect.left + listRect.width / 2, 0);
fixture.detectChanges();
await wait(10);
await wait(100);

expect(viewportRuler.getViewportScrollPosition().top).toBe(initialScrollDistance);
expect(list.scrollTop).toBeLessThan(50);
Expand Down Expand Up @@ -2770,7 +2770,7 @@ export function defineCommonDropListTests(config: {
startDraggingViaMouse(fixture, item);
dispatchMouseEvent(document, 'mousemove', listRect.left + listRect.width / 2, 0);
fixture.detectChanges();
await wait(10);
await wait(100);

expect(viewportRuler.getViewportScrollPosition().top).toBeLessThan(initialScrollDistance);
expect(list.scrollTop).toBe(0);
Expand Down
50 changes: 25 additions & 25 deletions src/material/sidenav/drawer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('MatDrawer', () => {
expect(testComponent.openStartCount).toBe(0);
expect(container.classList).not.toContain('mat-drawer-container-has-open');

await wait(20);
await wait(100);
expect(testComponent.openStartCount).toBe(1);
fixture.detectChanges();

Expand All @@ -72,7 +72,7 @@ describe('MatDrawer', () => {
expect(testComponent.closeCount).toBe(0);
expect(testComponent.closeStartCount).toBe(0);

await wait(20);
await wait(100);
expect(testComponent.closeStartCount).toBeGreaterThanOrEqual(1);
fixture.detectChanges();

Expand Down Expand Up @@ -181,7 +181,7 @@ describe('MatDrawer', () => {

drawer.componentInstance.open();
fixture.detectChanges();
await wait(20);
await wait(100);

expect(testComponent.openCount).withContext('Expected one open event.').toBe(1);
expect(testComponent.openStartCount).withContext('Expected one open start event.').toBe(1);
Expand All @@ -190,7 +190,7 @@ describe('MatDrawer', () => {

const event = dispatchKeyboardEvent(drawer.nativeElement, 'keydown', ESCAPE);
fixture.detectChanges();
await wait(20);
await wait(100);

expect(testComponent.closeCount).withContext('Expected one close event.').toBe(1);
expect(testComponent.closeStartCount).withContext('Expected one close start event.').toBe(1);
Expand Down Expand Up @@ -228,7 +228,7 @@ describe('MatDrawer', () => {
const fixture = TestBed.createComponent(DrawerSetToOpenedTrue);

fixture.detectChanges();
await wait(20);
await wait(100);

expect(fixture.componentInstance.openCallback).toHaveBeenCalledTimes(1);
});
Expand Down Expand Up @@ -280,7 +280,7 @@ describe('MatDrawer', () => {
openButton.focus();
drawer.open();
fixture.detectChanges();
await wait(20);
await wait(100);
fixture.detectChanges();

const backdrop = fixture.nativeElement.querySelector('.mat-drawer-backdrop');
Expand All @@ -294,7 +294,7 @@ describe('MatDrawer', () => {

backdrop.click();
fixture.detectChanges();
await wait(20);
await wait(100);

expect(document.activeElement)
.withContext('Expected focus to be restored to the open button on close.')
Expand All @@ -313,13 +313,13 @@ describe('MatDrawer', () => {
openButton.focus();
drawer.open();
fixture.detectChanges();
await wait(20);
await wait(100);
fixture.detectChanges();
drawerButton.focus();

drawer.close();
fixture.detectChanges();
await wait(20);
await wait(100);

expect(document.activeElement)
.withContext('Expected focus to be restored to the open button on close.')
Expand All @@ -337,13 +337,13 @@ describe('MatDrawer', () => {
svg.focus();
drawer.open();
fixture.detectChanges();
await wait(20);
await wait(100);
fixture.detectChanges();
drawerButton.focus();

drawer.close();
fixture.detectChanges();
await wait(20);
await wait(100);

expect(document.activeElement)
.withContext('Expected focus to be restored to the SVG element on close.')
Expand Down Expand Up @@ -496,7 +496,7 @@ describe('MatDrawer', () => {

drawer.open();
fixture.detectChanges();
await wait(20);
await wait(100);

expect(fixture.componentInstance.isOpen).toBe(true);
});
Expand Down Expand Up @@ -546,7 +546,7 @@ describe('MatDrawer', () => {

drawer.open();
fixture.detectChanges();
await wait(20);
await wait(100);
fixture.detectChanges();

expect(document.activeElement).toBe(firstFocusableElement);
Expand All @@ -560,7 +560,7 @@ describe('MatDrawer', () => {

drawer.open();
fixture.detectChanges();
await wait(20);
await wait(100);
fixture.detectChanges();

expect(document.activeElement).toBe(firstFocusableElement);
Expand All @@ -575,7 +575,7 @@ describe('MatDrawer', () => {

drawer.open();
fixture.detectChanges();
await wait(20);
await wait(100);
fixture.detectChanges();

expect(document.activeElement).toBe(firstFocusableElement);
Expand Down Expand Up @@ -618,7 +618,7 @@ describe('MatDrawer', () => {

drawer.open();
fixture.detectChanges();
await wait(20);
await wait(100);
fixture.detectChanges();

expect(document.activeElement).toBe(firstFocusableElement);
Expand All @@ -633,7 +633,7 @@ describe('MatDrawer', () => {

drawerEl.componentInstance.open();
nonFocusableFixture.detectChanges();
await wait(20);
await wait(100);
nonFocusableFixture.detectChanges();

expect(document.activeElement).toBe(drawerEl.nativeElement);
Expand Down Expand Up @@ -904,7 +904,7 @@ describe('MatDrawerContainer', () => {

fixture.componentInstance.drawer.open();
fixture.detectChanges();
await wait(20);
await wait(100);
fixture.detectChanges();

expect(parseInt(contentElement.style.marginLeft)).toBeGreaterThan(0);
Expand All @@ -916,7 +916,7 @@ describe('MatDrawerContainer', () => {
fixture.detectChanges();
fixture.componentInstance.drawer.open();
fixture.detectChanges();
await wait(20);
await wait(100);
fixture.detectChanges();

const contentElement = fixture.debugElement.nativeElement.querySelector('.mat-drawer-content');
Expand All @@ -938,7 +938,7 @@ describe('MatDrawerContainer', () => {
fixture.detectChanges();
fixture.componentInstance.drawer.open();
fixture.detectChanges();
await wait(20);
await wait(100);
fixture.detectChanges();

const contentElement = fixture.debugElement.nativeElement.querySelector('.mat-drawer-content');
Expand All @@ -959,7 +959,7 @@ describe('MatDrawerContainer', () => {
fixture.detectChanges();
fixture.componentInstance.drawer.open();
fixture.detectChanges();
await wait(20);
await wait(100);
fixture.detectChanges();

const contentElement = fixture.debugElement.nativeElement.querySelector('.mat-drawer-content');
Expand Down Expand Up @@ -998,7 +998,7 @@ describe('MatDrawerContainer', () => {
fixture.nativeElement.querySelector('.mat-drawer').style.width = 'auto';
fixture.componentInstance.drawer.open();
fixture.detectChanges();
await wait(20);
await wait(100);
fixture.detectChanges();

const contentEl = fixture.debugElement.nativeElement.querySelector('.mat-drawer-content');
Expand All @@ -1009,7 +1009,7 @@ describe('MatDrawerContainer', () => {
fixture.componentInstance.fillerWidth = 200;
fixture.changeDetectorRef.markForCheck();
fixture.detectChanges();
await wait(20);
await wait(100);
fixture.detectChanges();

expect(parseInt(contentEl.style.marginLeft)).toBeGreaterThan(initialMargin);
Expand All @@ -1027,15 +1027,15 @@ describe('MatDrawerContainer', () => {
// Open the drawer and resolve the open animation.
fixture.componentInstance.drawer.open();
fixture.detectChanges();
await wait(20);
await wait(100);
fixture.detectChanges();

expect(content.style.marginLeft).not.toBe('', 'Margin should be present when drawer is open');

// Close the drawer and resolve the close animation.
fixture.componentInstance.drawer.close();
fixture.detectChanges();
await wait(20);
await wait(100);
fixture.detectChanges();

expect(content.style.marginLeft)
Expand Down
5 changes: 3 additions & 2 deletions src/material/tooltip/tooltip.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1277,12 +1277,13 @@ describe('MatTooltip', () => {

dispatchFakeEvent(button, 'touchstart');
fixture.detectChanges();
await wait(250); // Halfway through the dela.
await wait(250); // Halfway through the delay.

assertTooltipInstance(fixture.componentInstance.tooltip, false);

await wait(500); // Finish the dela.
await wait(600); // Finish the delay.
fixture.detectChanges();
await fixture.whenStable();
finishCurrentTooltipAnimation(overlayContainerElement, true); // Finish the animation.

assertTooltipInstance(fixture.componentInstance.tooltip, true);
Expand Down
Loading