@@ -20,35 +20,28 @@ describe('BookListComponent', () => {
2020 imports : [
2121 RouterTestingModule . withRoutes ( [ ] )
2222 ] ,
23- providers : [ { provide : BookDataService , useClass : BookStaticAsyncDataService } ]
23+ providers : [ ]
2424 } )
2525 . compileComponents ( ) ;
2626 } ) ;
2727
2828 beforeEach ( ( ) => {
29- fixture = TestBed . createComponent ( BookListComponent ) ;
30- component = fixture . componentInstance ;
31- fixture . detectChanges ( ) ;
32- compiled = fixture . debugElement . nativeElement ;
29+ // create component and detect changes
3330 } ) ;
3431
3532 it ( 'should be created' , ( ) => {
3633 expect ( component ) . toBeTruthy ( ) ;
3734 } ) ;
3835
3936 it ( 'should recieve 3 Books' , ( ) => {
40- expect ( compiled . querySelectorAll ( '.book-row' ) . length ) . toBe ( 3 ) ;
37+ expect ( true ) . toBeFalsy ( ) ;
4138 } ) ;
4239
4340 it ( 'should display the title of each book' , ( ) => {
44- expect ( compiled . querySelectorAll ( '.book-row' ) [ 0 ] . innerText ) . toContain ( 'Design Patterns' ) ;
45- expect ( compiled . querySelectorAll ( '.book-row' ) [ 1 ] . innerText ) . toContain ( 'REST und HTTP' ) ;
46- expect ( compiled . querySelectorAll ( '.book-row' ) [ 2 ] . innerText ) . toContain ( 'Eloquent JavaScript' ) ;
41+ expect ( true ) . toBeFalsy ( ) ;
4742 } ) ;
4843
4944 it ( 'should link to the edit page of each book' , ( ) => {
50- expect ( compiled . querySelectorAll ( '.book-row a' ) [ 0 ] . href ) . toContain ( '/978-0-20163-361-0' ) ;
51- expect ( compiled . querySelectorAll ( '.book-row a' ) [ 1 ] . href ) . toContain ( '/978-3-86490-120-1' ) ;
52- expect ( compiled . querySelectorAll ( '.book-row a' ) [ 2 ] . href ) . toContain ( '/978-1-59327-584-6' ) ;
45+ expect ( true ) . toBeFalsy ( ) ;
5346 } ) ;
5447} ) ;
0 commit comments