ccaominh commented on a change in pull request #8484: Web console: Druid status displayed in a table URL: https://github.com/apache/incubator-druid/pull/8484#discussion_r323484690
########## File path: web-console/src/dialogs/status-dialog/status-dialog.spec.tsx ########## @@ -27,4 +27,19 @@ describe('status dialog', () => { render(statusDialog); expect(document.body.lastChild).toMatchSnapshot(); }); + it('filters data that contains input', () => { + const data = [ + 'org.apache.druid.common.gcp.GcpModule', + 'org.apache.druid.common.aws.AWSModule', + 'io.imply.druid.UtilityBeltModule', + ]; + let filterFunction; + filterFunction = (filter: { id: string | number; value: string }, row: { [x: string]: any }) => + String(row[filter.id]).includes(filter.value); Review comment: This method looks like it's testing a clone of the logic in the component. It's better if you can test the component via its interfaces/properties instead of testing a clone of the component's internal logic. That way, if the internal logic of the component changes later, your test will still be validating the component's behavior (whereas the clone will be stale). ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org