From 833c9f8f2ed31b1d9242517c52d1f2c3fb70d158 Mon Sep 17 00:00:00 2001 From: kunw Date: Wed, 17 May 2017 13:33:31 +0800 Subject: [PATCH] Refine spec of repository. --- src/ui_ng/lib/src/repository/repository.component.spec.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ui_ng/lib/src/repository/repository.component.spec.ts b/src/ui_ng/lib/src/repository/repository.component.spec.ts index 8793c6531..5b2a6c551 100644 --- a/src/ui_ng/lib/src/repository/repository.component.spec.ts +++ b/src/ui_ng/lib/src/repository/repository.component.spec.ts @@ -96,13 +96,14 @@ describe('RepositoryComponent (inline template)', ()=> { fixture.detectChanges(); comp.doSearchRepoNames('nginx'); fixture.detectChanges(); - let de: DebugElement = fixture.debugElement.query(By.css('datagrid-cell')); + let de: DebugElement[] = fixture.debugElement.queryAll(By.css('datagrid-cell')); fixture.detectChanges(); expect(de).toBeTruthy(); - let el: HTMLElement = de.nativeElement; + expect(de.length).toEqual(1); + let el: HTMLElement = de[0].nativeElement; + fixture.detectChanges(); expect(el).toBeTruthy(); expect(el.textContent).toEqual('library/nginx'); - expect(el.textContent).not.toEqual('library/busybox'); }); }));