Skip to content
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

[DT-1081] Fix filter bugs #2754

Merged
merged 2 commits into from
Dec 13, 2024
Merged

[DT-1081] Fix filter bugs #2754

merged 2 commits into from
Dec 13, 2024

Conversation

s-rubenstein
Copy link
Contributor

Addresses

Summary


Have you read Terra's Contributing Guide lately? If not, do that first.

  • Label PR with a Jira ticket number and include a link to the ticket
  • Label PR with a security risk modifier [no, low, medium, high]
  • PR describes scope of changes
  • Get a minimum of one thumbs worth of review, preferably two if enough team members are available
  • Get PO sign-off for all non-trivial UI or workflow changes
  • Verify all tests go green
  • Test this change deployed correctly and works on dev environment after deployment

@s-rubenstein s-rubenstein requested a review from a team as a code owner December 11, 2024 18:49
@s-rubenstein s-rubenstein requested review from rushtong and fboulnois and removed request for a team December 11, 2024 18:49
const filterHandlerStub = cy.stub();
const props = { datasets, filters: { ...defaultFilters(datasets), participantCountMin: 2, participantCountMax: 5 }, filterHandler: filterHandlerStub, isFiltered: () => {}};
mount(<DatasetFilterList {...props} />);
cy.get('#participantCountMax-range-input').type('3').trigger('change');
Copy link
Contributor

Choose a reason for hiding this comment

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

Chaining calls after type is unsafe. A lot of our tests suffer from this pattern, so it is something we should be trying to clean up.

@@ -303,7 +293,7 @@ export const DatasetSearchTable = (props) => {
</Box>
<Box sx={{display: 'flex', flexDirection: 'row', paddingTop: '2em'}}>
<Box sx={{width: '14%', padding: '0 1em'}}>
<DatasetFilterList datasets={datasets} filterHandler={filterHandler} isFiltered={isFilteredArray} onClear={() => setFilters(defaultFilters)}/>
<DatasetFilterList datasets={datasets} filterHandler={filterHandler} filters={filters} isFiltered={isFilteredArray} onClear={() => setFilters(defaultFilters(datasets))}/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Something about this is breaking the dataset_search_table.spec.js tests, but it's not exactly clear what. I think the tests might be a little brittle as well in that they're expecting a populated response.response.body[0] object.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I see it. The search filter text is slightly different in this PR which breaks the test. Changing line 68 in dataset_search_table.spec.js to:

return handler(req, '{"range":{"participantCount":{"gte":100,"lte":"50"}}}');

and line 91 to

return handler(req, '{"range":{"participantCount":{"gte":100,"lte":100}}}');

allows the string matching in the handler function to work correctly.

Copy link
Contributor

@rushtong rushtong left a comment

Choose a reason for hiding this comment

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

Looks reasonable, addresses bugs in ticket. Once tests are passing, 👍🏽

Copy link
Contributor

@fboulnois fboulnois left a comment

Choose a reason for hiding this comment

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

looks good, thank you 👍

@s-rubenstein s-rubenstein merged commit f997b4e into develop Dec 13, 2024
9 checks passed
@s-rubenstein s-rubenstein deleted the sr/dt-1081-fix-filter-bugs branch December 13, 2024 19:42
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.

3 participants