File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -36,4 +36,19 @@ describe('BookListComponent', () => {
3636 expect ( component ) . toBeTruthy ( ) ;
3737 } ) ;
3838
39+ it ( 'should recieve 3 Books' , ( ) => {
40+ expect ( compiled . querySelectorAll ( '.book-row' ) . length ) . toBe ( 3 ) ;
41+ } ) ;
42+
43+ 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' ) ;
47+ } ) ;
48+
49+ 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' ) ;
53+ } ) ;
3954} ) ;
You can’t perform that action at this time.
0 commit comments