[Bugfix:Testing] Fix specs that hardcode term#12978
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12978 +/- ##
=========================================
Coverage 21.35% 21.35%
Complexity 9990 9990
=========================================
Files 275 275
Lines 37317 37317
Branches 505 505
=========================================
Hits 7969 7969
Misses 28847 28847
Partials 501 501
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
GarvitKhandelwal31
left a comment
There was a problem hiding this comment.
Code looks good to me and should be merged on priority.
My suggestion for a follow-up PR -
We should definitely prevent future contributors to hardcode the term in future. Could we add a linting rule to catch this? Somewhere in site/eslint.config.js perhaps??
Thanks for the review! That is a very good idea. We could definitely add a linting rule about this, just pattern match s** and f** and warn about it. I will add that to my notes of things to work on. |
Should we throw a warning or an error? I am afraid warning might go unnoticed. We must find a clever and a robust way to do so if we plan to throw error. |
Sorry I wasn't clearer. What I meant to say is hardcoding the term should fail the Javascript Lint CI. If there was an eslint rule about it that would be the result, and of course if you ran eslint locally you would see the same thing. |
Why is this Change Important & Necessary?
What is the New Behavior?
some cypress specs are using hardcoded term values and fail when the testing term rolls over.
What steps should a reviewer take to reproduce or test the bug or new feature?
updated the failing specs to no longer hardcode the term and instead use the function in utils.js to dynamically get the semester.
Automated Testing & Documentation
Other information