[ADF-5415] remove deprecated async method (#7171)

* remove deprecated async method

* fix tests and code

* test fixes

* fix tests
This commit is contained in:
Denys Vuika
2021-07-12 20:09:47 +01:00
committed by GitHub
parent 059aa8ba06
commit a4c3f3a95b
41 changed files with 194 additions and 200 deletions

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AuthenticationService } from '../../services/authentication.service';
import { LoginDialogPanelComponent } from './login-dialog-panel.component';
import { of } from 'rxjs';
@@ -26,8 +26,9 @@ import { TranslateModule } from '@ngx-translate/core';
describe('LoginDialogPanelComponent', () => {
let component: LoginDialogPanelComponent;
let fixture: ComponentFixture<LoginDialogPanelComponent>;
let element: any;
let usernameInput, passwordInput;
let element: HTMLElement;
let usernameInput: HTMLInputElement;
let passwordInput: HTMLInputElement;
let authService: AuthenticationService;
setupTestBed({
@@ -37,23 +38,24 @@ describe('LoginDialogPanelComponent', () => {
]
});
beforeEach(async(() => {
beforeEach(async () => {
fixture = TestBed.createComponent(LoginDialogPanelComponent);
element = fixture.nativeElement;
component = fixture.componentInstance;
authService = TestBed.inject(AuthenticationService);
fixture.detectChanges();
fixture.whenStable().then(() => {
usernameInput = element.querySelector('#username');
passwordInput = element.querySelector('#password');
});
}));
await fixture.whenStable();
usernameInput = element.querySelector('#username');
passwordInput = element.querySelector('#password');
});
afterEach(() => {
fixture.destroy();
});
function loginWithCredentials(username, password) {
function loginWithCredentials(username: string, password: string) {
usernameInput.value = username;
passwordInput.value = password;