bito-code-review[bot] commented on code in PR #38579:
URL: https://github.com/apache/superset/pull/38579#discussion_r2939570988
##########
superset-frontend/src/visualizations/TimeTable/utils/sortUtils/sortUtils.test.ts:
##########
@@ -76,24 +67,25 @@ describe('sortNumberWithMixedTypes', () => {
const rowA = createMockRow(null);
const rowB = createMockRow(10);
- const result = sortNumberWithMixedTypes(rowA, rowB, 'testColumn', false);
+ const result = sortNumberWithMixedTypes(rowA, rowB, 'testColumn');
expect(typeof result).toBe('number');
});
test('should handle string numbers', () => {
const rowA = createMockRow('10');
const rowB = createMockRow('20');
- const result = sortNumberWithMixedTypes(rowA, rowB, 'testColumn', false);
+ const result = sortNumberWithMixedTypes(rowA, rowB, 'testColumn');
- expect(result).toBeLessThan(0);
+ expect(typeof result).toBe('number');
+ expect(result).toBe(0);
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Incorrect test assertion</b></div>
<div id="fix">
The test assertion expects the sort result to be 0 for string numbers '10'
and '20', but the sortNumberWithMixedTypes function returns a negative value
since '10' < '20' in ascending order. This mismatch will cause the test to
fail, potentially blocking the merge.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
````suggestion
expect(typeof result).toBe('number');
expect(result).toBeLessThan(0);
````
</div>
</details>
</div>
<small><i>Code Review Run #a3e4c1</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]