bito-code-review[bot] commented on PR #42440:
URL: https://github.com/apache/superset/pull/42440#issuecomment-5113169232
<!-- Bito Reply -->
The flagged issue is correct. The current test only verifies the presence of
the field name in the URL, which is insufficient to ensure the filter is
correctly applied with the expected operator and value. To resolve this, you
should parse the Rison-encoded filters from the request URL and assert the
specific filter object.
Here is the corrected test implementation:
```typescript
import { parseRison } from 'src/utils/rison';
// ... inside the test
const lastCall = calls[calls.length - 1];
const url = new URL(lastCall.url, window.location.origin);
const filters = parseRison(url.searchParams.get('filters') || '');
expect(filters).toContainEqual({
col: 'expose_in_sqllab',
opr: 'eq',
value: true,
});
```
There are no other comments on this PR to address.
**superset-frontend/src/components/DatabaseSelector/DatabaseSelector.test.tsx**
```
const lastCall = calls[calls.length - 1];
const url = new URL(lastCall.url, window.location.origin);
const filters = parseRison(url.searchParams.get('filters') || '');
expect(filters).toContainEqual({
col: 'expose_in_sqllab',
opr: 'eq',
value: true,
});
```
--
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]