-
Notifications
You must be signed in to change notification settings - Fork 0
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
Replace ==
in the views with ===
#1636
Conversation
It has been spotted in a few views that we have been using `==` rather than `===`. Generally we use the strict comparison `===` to compare content & type unless it is absolutely necessary to perform a loose equality comparison. It looks like it is not necessary to use `==` in the views. So where applicable they will be updated to `===`.
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.
I'm happy to approve. But only if the acceptance tests report zero failures when run.
Could you add a screenshot of the test summary to the PR to confirm this?
Running the acceptance tests highlighted an issue with the view `app/views/bill-runs/review/review-licence.njk`. It was breaking when I updated line 237 to this `{% if matchedReturns.length === 0 and unmatchedReturns.length === 0 %}`. After some investigation I found that `matchedReturns` & `unmatchedReturns` are arrays, not numbers. The `==` seemed to work when assessing if the array was empty. Just goes to show how loose the `==` matching is. I've therefore updated it to what I expect it should have been in the first place unmatchedReturns.length === 0 and it now works fine.
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.
It has been spotted in a few views that we have been using
==
rather than===
.Generally, we use the strict comparison
===
to compare content & type unless it is necessary to perform a loose equality comparison.It looks like it is not necessary to use
==
in the views. So where applicable they will be updated to===
.