mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
test(slide-toggle): adding missing detectChanges() and tick() (#15309)
This makes a test pass both with ivy and ViewEngine
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user