-
Notifications
You must be signed in to change notification settings - Fork 344
Add Optimiser Unit Tests #4094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add Optimiser Unit Tests #4094
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@leslieyip02 is attempting to deploy a commit to the modsbot's projects Team on Vercel. A member of the Team first needs to authorize it. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4094 +/- ##
==========================================
+ Coverage 54.52% 55.09% +0.56%
==========================================
Files 274 297 +23
Lines 6076 6716 +640
Branches 1455 1608 +153
==========================================
+ Hits 3313 3700 +387
- Misses 2763 3016 +253 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM good refactor and tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good but i'm not sure if it's a refactor or latest merge changes. The tooltip (i) is broken and there are font changes (Time dropdown text is significantly larger). Not sure if these are intended. Just merged master in to this and hopefully some of these are fixed. If not, let's try to keep the fonts more uniform

Tooltips still broken :( |
@thejus03 I standardized the dropdown sizes so that the dropdowns look more uniform. However, if we add more dropdowns in the future, we can always customize their widths. |
# Conflicts: # website/src/views/optimiser/OptimiserForm/OptimiserFreeDaySelect.tsx
225a4e9
to
e119719
Compare
website/src/views/optimiser/OptimiserForm/OptimiserFreeDaySelect.tsx
Outdated
Show resolved
Hide resolved
|
||
<div className={styles.freeDaysButtons}> | ||
{days.map((day) => ( | ||
<button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's okay but you might consider using a proper checkbox instead https://getbootstrap.com/docs/4.6/components/forms/#custom-forms
website/src/views/optimiser/OptimiserForm/OptimiserTimeRangeSelect.tsx
Outdated
Show resolved
Hide resolved
website/src/views/optimiser/OptimiserContainer/OptimiserContent.tsx
Outdated
Show resolved
Hide resolved
website/src/views/optimiser/OptimiserContainer/OptimiserContent.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UI changes were made to address @ZhangYiJiang's comments on accessibility. The free days select should be OK, but I think I'll push a commit to make the dropdown fit in better with the rest of the form (I hadn't checked Safari, but it looks a bit jarring). Update: I've updated the dropdown to use
|
Context
Closes #4092.
Legacy Issues
Closes #4095.
Closes #4102.
Implementation
types
folderutils
folder + unit testsOptimiserForm
codeNotes
Replaced
uniqueKey
withlessonKey
Previously, we had:
uniqueKey
=>{moduleCode}-{lessonType}
displayText
=>{moduleCode} {lessonType}
lessonKey
=>{moduleCode}|{lessonType}
I replaced
uniqueKey
because I think the deduplication makes the code a bit easier to follow.useOptimiserForm
custom hookWe had a lot of
useState
calls inOptimiserContent
, and they were being passed toOptimiserForm
as well. I think having a custom hook makes it easier to pass around, and allowed to pass props down to individual form fields, e.g.: