simonjvardy / alarm-clock

Alarm Clock app using HTML5, CSS3 and JavaScript. Code Institute Milestone 2 Project.
https://simonjvardy.github.io/alarm-clock/
6 stars 8 forks source link

Unit Test: Once the alarm is triggered it keeps playing a sound until the browser window is closed! #26

Closed simonjvardy closed 3 years ago

simonjvardy commented 3 years ago

Describe the bug Once the alarm conditions are met (Alarm Time - Current Time == 0) The sound plays continuously. It doesn't switch off unless the browser window is closed

To Reproduce Steps to reproduce the behavior:

  1. Go to https://simonjvardy.github.io/world-clock/index.html
  2. Click on Alarm Clock accordion
  3. Enter hours and minutes values
  4. Set the toggle switch to ON
  5. Wait for the alarm to sound
  6. The alarm is triggered but keeps on playing

Expected behavior The feature needs a timout feature if the alarm remains on or the alarm sound needs to stop if the toggle switch is set to OFF

Desktop (please complete the following information):

simonjvardy commented 3 years ago

Refactored alarm.js to pause the audio playback on button click to clear the alarm