sadpandajoe commented on code in PR #44858:
URL: https://github.com/apache/superset/pull/44858#discussion_r4178541170


##########
superset-frontend/src/components/Datasource/components/CollectionTable/CollectionTable.test.tsx:
##########
@@ -27,10 +28,242 @@ const props = {
   sortColumns: [],
 };
 
+test('keeps tie order stable when pagination reapplies a descending sort', () 
=> {
+  const collection = Array.from({ length: 30 }, (_, i) => ({
+    id: i + 1,
+    column_name: `col_${i + 1}`,
+    verbose_name: '',
+  }));
+
+  const { container } = render(
+    <CollectionTable
+      collection={collection}
+      tableColumns={['column_name', 'verbose_name']}
+      sortColumns={['verbose_name']}
+      pagination={{ pageSize: 25 }}
+    />,
+  );
+
+  const sorters = container.querySelectorAll('.ant-table-column-sorters');
+  // ascend -> descend on the all-blank verbose_name column.
+  fireEvent.click(sorters[1]);

Review Comment:
   Only `verbose_name` is sortable here, so `.ant-table-column-sorters` 
contains one element and `sorters[1]` is undefined; the first click throws 
before the pagination assertions run. Could this select the sole sorter so the 
regression test reaches those assertions?



-- 
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]

Reply via email to