bito-code-review[bot] commented on code in PR #42440:
URL: https://github.com/apache/superset/pull/42440#discussion_r3672033690
##########
superset-frontend/src/components/DatabaseSelector/DatabaseSelector.test.tsx:
##########
@@ -390,3 +390,21 @@ test('Sends the correct schema when changing the schema',
async () => {
);
expect(props.onSchemaChange).toHaveBeenCalledTimes(1);
});
+
+test('should include expose_in_sqllab filter when filterBySqlLab is true',
async () => {
+ const props = createProps();
+ render(<DatabaseSelector {...props} sqlLabMode={false} filterBySqlLab />, {
+ useRedux: true,
+ store,
+ });
+ const select = screen.getByRole('combobox', {
+ name: 'Select database or type to search databases',
+ });
+ await userEvent.click(select);
+ await waitFor(() => {
+ const calls = fetchMock.callHistory.calls(databaseApiRoute);
+ expect(calls.length).toBeGreaterThanOrEqual(1);
+ const lastCall = calls[calls.length - 1];
+ expect(lastCall.url).toContain('expose_in_sqllab');
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Incomplete assertion on filter value</b></div>
<div id="fix">
The assertion only checks for the presence of `'expose_in_sqllab'` in the
URL string, but doesn't verify the value is `true`. This allows a subtle
regression where the filter might be added with an incorrect value (e.g.,
`false` or missing) without the test catching it.
</div>
</div>
<small><i>Code Review Run #a0754a</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]