refactor(tests): simplify code (#11485)
This commit is contained in:

committed by
Evan Martin

parent
f5d44a42c9
commit
5a4e46db20
@ -67,13 +67,13 @@ export function main() {
|
||||
it('should work with mutable objects', async(() => {
|
||||
let fixture = TestBed.createComponent(TestComp);
|
||||
let mutable: number[] = [1];
|
||||
fixture.debugElement.componentInstance.data = mutable;
|
||||
fixture.componentInstance.data = mutable;
|
||||
fixture.detectChanges();
|
||||
expect(fixture.debugElement.nativeElement).toHaveText('[\n 1\n]');
|
||||
expect(fixture.nativeElement).toHaveText('[\n 1\n]');
|
||||
|
||||
mutable.push(2);
|
||||
fixture.detectChanges();
|
||||
expect(fixture.debugElement.nativeElement).toHaveText('[\n 1,\n 2\n]');
|
||||
expect(fixture.nativeElement).toHaveText('[\n 1,\n 2\n]');
|
||||
|
||||
}));
|
||||
});
|
||||
|
@ -96,13 +96,13 @@ export function main() {
|
||||
it('should work with mutable arrays', async(() => {
|
||||
let fixture = TestBed.createComponent(TestComp);
|
||||
let mutable: number[] = [1, 2];
|
||||
fixture.debugElement.componentInstance.data = mutable;
|
||||
fixture.componentInstance.data = mutable;
|
||||
fixture.detectChanges();
|
||||
expect(fixture.debugElement.nativeElement).toHaveText('2');
|
||||
expect(fixture.nativeElement).toHaveText('2');
|
||||
|
||||
mutable.push(3);
|
||||
fixture.detectChanges();
|
||||
expect(fixture.debugElement.nativeElement).toHaveText('2,3');
|
||||
expect(fixture.nativeElement).toHaveText('2,3');
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user