File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -35,3 +35,39 @@ describe('Meals Counter function Test', () => {
35
35
expect ( mealLength ) . toBe ( 4 ) ;
36
36
} ) ;
37
37
} ) ;
38
+
39
+ describe ( 'Comments Counter function Test' , ( ) => {
40
+ const commentArray = [
41
+ {
42
+ commentID : 1204 ,
43
+ mealName : 'Bread and Butter Pudding' ,
44
+ commentDescription : 'This Food Is Very Awesome. I Love It' ,
45
+ } ,
46
+ {
47
+ commentID : 1790 ,
48
+ mealName : 'Bakewell tart' ,
49
+ commentDescription : 'Awesome Food' ,
50
+ } ,
51
+ ] ;
52
+ test ( 'should return comment array length of 2' , ( ) => {
53
+ const commentLength = counter . comments ( commentArray ) ;
54
+ expect ( commentLength ) . toBe ( 2 ) ;
55
+ } ) ;
56
+
57
+ test ( 'should return comment array length of 1 ' , ( ) => {
58
+ commentArray . push (
59
+ {
60
+ commentID : 2080 ,
61
+ mealName : 'Beef Wellington' ,
62
+ commentDescription : 'I Would Like To Eat This' ,
63
+ } ,
64
+ {
65
+ commentID : 2190 ,
66
+ mealName : 'this is a nice meal' ,
67
+ commentDescription : 'no comment description' ,
68
+ } ,
69
+ ) ;
70
+ const commentLength = counter . comments ( commentArray ) ;
71
+ expect ( commentLength ) . toBe ( 4 ) ;
72
+ } ) ;
73
+ } ) ;
You can’t perform that action at this time.
0 commit comments