Skip to content

Commit 6f12cda

Browse files
committed
fixup! feat(material/button): make button ripples lazy
1 parent 6934609 commit 6f12cda

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/material/button/button.spec.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {waitForAsync, ComponentFixture, TestBed} from '@angular/core/testing';
1+
import {waitForAsync, ComponentFixture, TestBed, fakeAsync, tick} from '@angular/core/testing';
22
import {ApplicationRef, Component, DebugElement} from '@angular/core';
33
import {By} from '@angular/platform-browser';
44
import {MatButtonModule, MatButton, MatFabDefaultOptions, MAT_FAB_DEFAULT_OPTIONS} from './index';
@@ -325,7 +325,7 @@ describe('MDC-based MatButton', () => {
325325
).toBe(false);
326326
});
327327

328-
it('should have a focus indicator after the user interacts', () => {
328+
it('should have a focus indicator after the user interacts', fakeAsync(() => {
329329
const fixture = TestBed.createComponent(TestApp);
330330
fixture.detectChanges();
331331
const buttonNativeElements = [
@@ -336,10 +336,12 @@ describe('MDC-based MatButton', () => {
336336
element.dispatchEvent(new Event('mouseenter'));
337337
}
338338

339+
tick(50);
340+
339341
expect(
340342
buttonNativeElements.every(element => !!element.querySelector('.mat-mdc-focus-indicator')),
341343
).toBe(true);
342-
});
344+
}));
343345
});
344346

345347
describe('MatFabDefaultOptions', () => {

0 commit comments

Comments
 (0)