test(slide-toggle): adding missing detectChanges() and tick() (#15309)

This makes a test pass both with ivy and ViewEngine
This commit is contained in:
Jeremy Elbourn
2019-02-26 08:58:43 -08:00
committed by GitHub
parent 53b01bcab2
commit 740a2eeaa9
@@ -435,6 +435,8 @@ describe('MatSlideToggle without forms', () => {
]
});
const fixture = TestBed.createComponent(SlideToggleBasic);
fixture.detectChanges();
const testComponent = fixture.debugElement.componentInstance;
const slideToggleDebug = fixture.debugElement.query(By.css('mat-slide-toggle'));
const thumbContainerDebug = slideToggleDebug
@@ -448,6 +450,7 @@ describe('MatSlideToggle without forms', () => {
expect(slideToggle.checked).toBe(false);
gestureConfig.emitEventForElement('slidestart', slideThumbContainer);
tick();
expect(slideThumbContainer.classList).toContain('mat-dragging');