Skip to content

Commit 325d51a

Browse files
authored
Merge pull request #39 from yaseerokino/test
Test for Comments
2 parents fba2589 + eb66a47 commit 325d51a

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

src/modules/test/counter.test.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,39 @@ describe('Meals Counter function Test', () => {
3535
expect(mealLength).toBe(4);
3636
});
3737
});
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+
});

0 commit comments

Comments
 (0)