@@ -5,17 +5,17 @@ import Table from '../Table';
55
66describe ( 'Table Component' , ( ) => {
77 const employeeData = [
8- { id : 1 , fullName : 'John Smith' , age : 23 , isIntern : false } ,
9- { id : 2 , fullName : 'Anna Donie' , age : 35 , isIntern : true } ,
10- { id : 3 , fullName : 'Hannah Brown' , age : 20 , isIntern : true } ,
11- { id : 4 , fullName : 'Johnathan White Jr' , age : 36 , isIntern : false } ,
8+ { id : 1 , fullName : 'John Smith' , age : 23 , isIntern : false } ,
9+ { id : 2 , fullName : 'Anna Donie' , age : 35 , isIntern : true } ,
10+ { id : 3 , fullName : 'Hannah Brown' , age : 20 , isIntern : true } ,
11+ { id : 4 , fullName : 'Johnathan White Jr' , age : 36 , isIntern : false } ,
1212 ] ;
1313
1414 const employeeKey = [
15- { key : 1 , name : 'Employee Id' } ,
16- { key : 2 , name : 'Full Name' } ,
17- { key : 3 , name : 'Age' } ,
18- { key : 4 , name : 'In Internship' } ,
15+ { key : 1 , name : 'Employee Id' } ,
16+ { key : 2 , name : 'Full Name' } ,
17+ { key : 3 , name : 'Age' } ,
18+ { key : 4 , name : 'In Internship' } ,
1919 ] ;
2020
2121 let result : RenderResult ;
@@ -33,16 +33,16 @@ describe('Table Component', () => {
3333 expect ( tableElements . length ) . toEqual ( 1 ) ;
3434 expect ( tableElements [ 0 ] ) . toBeTruthy ( ) ;
3535 } ) ;
36-
36+
3737 it ( 'renders correct user defined headers' , ( ) => {
3838 const headerRows = container . querySelectorAll ( 'table thead tr' ) ;
3939 expect ( headerRows . length ) . toEqual ( 1 ) ;
40-
40+
4141 const headers = headerRows [ 0 ] . querySelectorAll ( 'th' ) ;
4242 expect ( headers . length ) . toEqual ( 4 ) ;
4343
4444 headers . forEach ( ( header , index ) => {
45- expect ( header . textContent ) . toEqual ( employeeKey [ index ] . name ) ;
45+ expect ( header . textContent ) . toEqual ( employeeKey [ index ] . name ) ;
4646 } ) ;
4747 } ) ;
4848
@@ -58,7 +58,9 @@ describe('Table Component', () => {
5858 expect ( dataCells . length ) . toEqual ( 4 ) ;
5959
6060 dataCells . forEach ( ( cell , cellIndex ) => {
61- cell . textContent = Object . values ( employeeData [ rowIndex ] ) [ cellIndex ] . toString ( ) ;
61+ cell . textContent = Object . values ( employeeData [ rowIndex ] ) [
62+ cellIndex
63+ ] . toString ( ) ;
6264 } ) ;
6365 } ) ;
6466 } ) ;
0 commit comments