mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
test: fix flaky slide-toggle test with pending timer task
One of the slide-toggle tests has become quite flaky the last days and after debugging ZoneJS it turns out that this is related to the `(focus)` event from the `FocusMonitor` and we can safely improve the stability of the test by removing the `fakeAsync` which isn't needed anyway. For reference: Other tests asserting the `click` event on the slide-toggle native element also have a `tick()` specified but we don't need to wait for pending timers anyway.. so we can just remove `fakeAsync .
This commit is contained in:
committed by
mmalerba
parent
bdc681108b
commit
86da318c28
@@ -389,7 +389,7 @@ describe('MatSlideToggle without forms', () => {
|
||||
});
|
||||
|
||||
describe('custom action configuration', () => {
|
||||
it('should not change value on click when click action is noop', fakeAsync(() => {
|
||||
it('should not change value on click when click action is noop', () => {
|
||||
TestBed
|
||||
.resetTestingModule()
|
||||
.configureTestingModule({
|
||||
@@ -430,7 +430,7 @@ describe('MatSlideToggle without forms', () => {
|
||||
expect(slideToggle.checked).toBe(false, 'Expect slide toggle value not changed');
|
||||
expect(testComponent.toggleTriggered).toBe(2, 'Expect toggle twice');
|
||||
expect(testComponent.dragTriggered).toBe(0);
|
||||
}));
|
||||
});
|
||||
|
||||
it('should not change value on dragging when drag action is noop', fakeAsync(() => {
|
||||
TestBed
|
||||
|
||||
Reference in New Issue
Block a user