Skip to content

Commit adf628a

Browse files
committed
added event listener for keyup to update the counter when the user types in the input field.
1 parent 3be2859 commit adf628a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Sprint-2/implement/contains.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ as the object doesn't contains a key of 'c'
2020
// Given an empty object
2121
// When passed to contains
2222
// Then it should return false
23-
test.todo("contains on empty object returns false");
23+
test("contains on empty object returns false", () => {
24+
expect(contains({}, "a")).toEqual(false);
25+
});
2426

2527
// Given an object with properties
2628
// When passed to contains with an existing property name

Sprint-3/alarmclock/alarmclock.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ let seconds = 0;
1010
let minutes = 0;
1111

1212
function main() {
13-
// add an event listener to the "input" element that will call the counterUpdate function when clicked on
13+
// add an event listener to the "input" element that will call the counterUpdate function when clicked on or when the user types in the input field.
1414
document.getElementById("alarmSet").addEventListener("click", counterUpdate);
15+
document.getElementById("alarmSet").addEventListener("keyup", counterUpdate);
1516
}
1617

1718
// define the function that will update the counter

0 commit comments

Comments
 (0)