Skip to content
This repository was archived by the owner on May 30, 2023. It is now read-only.

Comments

fix: assert time-left is formatted correctly#772

Merged
tbushman merged 1 commit intofreeCodeCamp:masterfrom
abdusabri:fix/assert-time-left-format
Jan 31, 2019
Merged

fix: assert time-left is formatted correctly#772
tbushman merged 1 commit intofreeCodeCamp:masterfrom
abdusabri:fix/assert-time-left-format

Conversation

@abdusabri
Copy link
Contributor

Pre-Submission Checklist

  • Your pull request targets the master branch of freeCodeCamp/testable-projects-fcc
  • Branch starts with either fix/, feature/, or translate/ (e.g. fix/signin-issue)
  • You have only one commit (if not, squash them into one commit).
  • Your changes have been tested either locally or using a newly created CDN based on your fork's testable-projects-fcc/build/bundle.js file
  • Working changes have been added to the build by running npm run build

Type of Change

  • Small bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Add new translation (feature adding new translations)

Checklist:

  • Tested changes locally.

Description

This PR fixes an assertion issue for the pomodoro clock testing project. The issue was that all tests pass even if the time-left was incorrectly formatted as 00:00 instead of 60:00 when session length is set to 60

The following screenshots demonstrate the fix

image

image

An example project before the fix can be found here: https://abdusabri.github.io/fcc-pomodoro-bug/
An example project after the fix can be found here: https://abdusabri.github.io/fcc-pomodoro-fix/

@tbushman
Copy link
Contributor

@abdusabri I was trying both the links you posted, and noticed the tests pass for both. Did you update the first link listed above?

@abdusabri
Copy link
Contributor Author

Thanks for checking @tbushman

I didn't change either of the links

https://abdusabri.github.io/fcc-pomodoro-bug/ -> uses the CDN version of the tests, and all tests pass

https://abdusabri.github.io/fcc-pomodoro-fix/ -> uses a production build of this PR's tests, and one test fails (screenshots in this PR's description)

Would it help if i send a few screenshots comparing them (showing the urls and more details)?

@tbushman
Copy link
Contributor

@abdusabri Mainly I checked the first link, expecting it to fail. Sorry. I think we're probably good. Thanks for your patience.

@abdusabri
Copy link
Contributor Author

@tbushman No worries! 🙂 and thanks for reviewing!

@tbushman
Copy link
Contributor

@abdusabri I noticed we're using a RegExp on line 83. I think it would be safest to emulate that style of assertion.

fix: assert time-left is formatted correctly

fix: assert time-left is formatted correctly, use getMinutes
@abdusabri abdusabri force-pushed the fix/assert-time-left-format branch from cd4184a to 7d0a548 Compare January 31, 2019 10:40
@abdusabri
Copy link
Contributor Author

@tbushman Thanks for the feedback

I've updated the code to use getMinutes function, which uses the RegExp, and I've rebased and squashed the commits.

@tbushman
Copy link
Contributor

Alrighty, @abdusabri ! Thanks for your contribution. Congratulations on your first contribution to this repository. LGTM!

@tbushman tbushman merged commit 783be40 into freeCodeCamp:master Jan 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suite is missing a test for a pomodoro clock edge case

2 participants