Copilot commented on code in PR #39984:
URL: https://github.com/apache/superset/pull/39984#discussion_r3275862995
##########
superset-frontend/src/pages/ChartList/ChartList.listview.test.tsx:
##########
@@ -267,7 +267,7 @@ test('sorts table when clicking column headers', async ()
=> {
.filter(
call =>
call.url.includes('order_column') &&
- call.url.includes('last_saved_at'),
+ call.url.includes('changed_on_delta_humanized'),
);
expect(lastModifiedSortCalls).toHaveLength(1);
Review Comment:
In this test, there is already an initial GET to `/api/v1/chart/?q=...` on
mount that includes `order_column:changed_on_delta_humanized` (see
ChartList.test.tsx "makes correct API calls on initial load"). After clicking
the “Last modified” header, a second request will also use
`order_column:changed_on_delta_humanized`, so `toHaveLength(1)` is no longer
correct and will be flaky/fail. Consider clearing fetchMock history before the
click, or asserting against the most recent call / additionally filtering by
`order_direction` (or by the exact `order_column:changed_on_delta_humanized`
segment) so the test validates the click-triggered sort request specifically.
--
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]