mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5422] remove deprecated "async()" from unit tests (#7109)
* remove angualar async from content services * upgrade more tests * upgrade core tests * upgrade tests * fix deprecated constant * fix tests * fix after rebase
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { setupTestBed } from '../../../../testing/setup-test-bed';
|
||||
import { CoreTestingModule } from '../../../../testing/core.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -46,29 +46,33 @@ describe('SelectFilterInputComponent', () => {
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should focus input on initialization', async(() => {
|
||||
it('should focus input on initialization', async () => {
|
||||
spyOn(component.selectFilterInput.nativeElement, 'focus');
|
||||
matSelect.openedChange.next(true);
|
||||
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
|
||||
expect(component.selectFilterInput.nativeElement.focus).toHaveBeenCalled();
|
||||
}));
|
||||
});
|
||||
|
||||
it('should clear search term on close', async(() => {
|
||||
it('should clear search term on close', async () => {
|
||||
component.onModelChange('some-search-term');
|
||||
expect(component.term).toBe('some-search-term');
|
||||
|
||||
matSelect.openedChange.next(false);
|
||||
|
||||
fixture.detectChanges();
|
||||
expect(component.term).toBe('');
|
||||
}));
|
||||
await fixture.whenStable();
|
||||
|
||||
it('should emit event when value changes', async(() => {
|
||||
expect(component.term).toBe('');
|
||||
});
|
||||
|
||||
it('should emit event when value changes', async () => {
|
||||
spyOn(component.change, 'next');
|
||||
component.onModelChange('some-search-term');
|
||||
expect(component.change.next).toHaveBeenCalledWith('some-search-term');
|
||||
}));
|
||||
});
|
||||
|
||||
it('should reset value on reset() event', () => {
|
||||
component.onModelChange('some-search-term');
|
||||
|
Reference in New Issue
Block a user