Skip to content

Conversation

@log0s
Copy link
Contributor

@log0s log0s commented Mar 13, 2025

Adds a new filter type and fixes a bug with the range filters.

@log0s
Copy link
Contributor Author

log0s commented Mar 13, 2025

Got another one for you @parksjr. No rush on it, won't need it in for a bit.

@parksjr
Copy link
Collaborator

parksjr commented Mar 14, 2025

@log0s some automated checks failed around testing

@log0s
Copy link
Contributor Author

log0s commented Mar 14, 2025

@log0s some automated checks failed around testing

Yeah I think that was just coverage again. Do you know how that's calculated? I added a basic test for the new component but maybe it wants more tests?

@parksjr
Copy link
Collaborator

parksjr commented Mar 25, 2025

Hey @log0s my bad for the delay, I did not see the reply notification. anyway, its jest test coverage and it scans files and functions within, detects covered and uncovered lines based on runnable tests, and it reports on each file in the logs (here is a link to the coverage report in the last run right here on this PR). And each file has percentages of line coverage, branch, and functions, and it also lists line numbers not covered. Here is what that looks like for the relevant components in this feature:

  • SearchFiltersList.js - 79.31% line coverage
    • uncovered lines: 54-55,66,79,139,141
  • SearchFiltersMinMax.js - 21.42% line coverage
    • uncovered lines: 28-32,37-135

I think a lot of those lines in the new component could benefit from a little more test coverage. Since its a form component, add a user action test. Also, test out those min max error conditions. I hope that helps, I'll keep my eye on this and help you get it through when ready.

@log0s
Copy link
Contributor Author

log0s commented Mar 25, 2025

No worries @parksjr, like I said no huge rush on this. Added a couple tests for the error display and that seems to have bumped it up enough. Let me know how it looks now.

Copy link
Collaborator

@parksjr parksjr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments for you

Comment on lines 27 to 34
useEffect(() => {
if (maxError === true) {
handleInputChange({ target: { id: `${namePrefix}-max`, value: valueMaxLocal.toString() } });
}
if (minError === true) {
handleInputChange({ target: { id: `${namePrefix}-min`, value: valueMinLocal.toString() } });
}
}, [valueMinLocal, valueMaxLocal]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious about this useEffect. It re-triggers the change handler when either of the error states is true. The handler itself is responsible for updating the error state. I removed it and things still work fine, but i might be missing something. Let me know what if there's something i'm missing about this so I can understand

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure, another thing I copied over and didn't quite understand completely. I'll take it out.

log0s and others added 3 commits March 27, 2025 09:34
Co-authored-by: Michael Parks <mike@parksjr.tech>
….Default.stories.js

Co-authored-by: Michael Parks <mike@parksjr.tech>
@log0s
Copy link
Contributor Author

log0s commented Mar 27, 2025

Great feedback, thanks @parksjr. Let me know how it looks now.

@parksjr parksjr merged commit 98e1c65 into Element84:main Apr 2, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants