[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:
Denys Vuika
2021-06-15 16:16:15 +01:00
committed by GitHub
parent ba03c60adb
commit 3079aa48c3
121 changed files with 5316 additions and 4780 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 { By } from '@angular/platform-browser';
import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox';
import { setupTestBed } from '../../../testing/setup-test-bed';
@@ -68,7 +68,7 @@ describe('CardViewBoolItemComponent', () => {
expect(value).not.toBeNull();
});
it('should NOT render the label and value if the property is NOT editable and doesn\'t have a proper boolean value set', () => {
it('should NOT render the label and value if the property is NOT editable and has no proper boolean value set', () => {
component.editable = true;
component.property.value = undefined;
component.property.editable = false;
@@ -189,15 +189,16 @@ describe('CardViewBoolItemComponent', () => {
expect(cardViewUpdateService.update).toHaveBeenCalledWith(property, true);
});
it('should update the property value after a changed', async(() => {
it('should update the property value after a changed', async () => {
component.property.value = true;
component.changed(<MatCheckboxChange> { checked: false });
fixture.whenStable().then(() => {
expect(component.property.value).toBe(false);
});
}));
fixture.detectChanges();
await fixture.whenStable();
expect(component.property.value).toBe(false);
});
it('should trigger an update event on the CardViewUpdateService [integration]', (done) => {
const cardViewUpdateService = TestBed.inject(CardViewUpdateService);