Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tests/changehandler.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ test("amountDue is set based on an argument", function(){
})

test("Returns true if cashTendered more than amountDue", function(){
//these tests should be testing your isPaymentSufficient() function, so you start with an amount due,
//enter a coin or set cashTendered to a value thats more than the amount due and your expect would be:
const changeHandler = new ChangeHandler(85)
changeHandler.cashTendered = 90
expect(changeHandler.cashTendered >= changeHandler.amountDue).toBe(true)
expect(changeHandler.isPaymentSufficient()).toBe(true)
// expect(changeHandler.cashTendered >= changeHandler.amountDue).toBe(true)
})

test("Returns false if cashTendered less than amountDue", function(){
Expand Down Expand Up @@ -88,4 +91,4 @@ test("amountDue is set based on an argument", function(){
changeHandler.cashTendered = 148
expect(changeHandler.giveChange(68)).toEqual({quarters: 2, dimes: 1, nickels: 1, pennies: 3})
})
})
})