gabotorresruiz commented on code in PR #42879:
URL: https://github.com/apache/superset/pull/42879#discussion_r3784733200


##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/GroupByFilterCard.test.tsx:
##########
@@ -39,3 +51,27 @@ test('preserves source order when sortAscending is unset', 
() => {
   expect(compare(apple, banana)).toBe(0);
   expect(compare(banana, apple)).toBe(0);
 });
+
+const groupByCustomization = {
+  id: 'groupby-1',
+  name: 'Group By',
+  filterType: 'filter_groupby',
+  type: ChartCustomizationType.ChartCustomization,
+  targets: [{ datasetId: 1 }],
+  scope: { rootPath: [], excluded: [] },
+  controlValues: {},
+  defaultDataMask: {},
+} as unknown as ChartCustomization;

Review Comment:
   Just a small NIT: the `as unknown as ChartCustomization` double-cast is 
unnecessary and turns off type checking of the fixture, so a typo like 
`target:` instead of `targets:` would compile and the test would silently 
exercise the no-dataset early return instead of the loading branch. The literal 
satisfies the type directly; I verified `npm run type` and the test both pass 
with:
   ```ts
   const groupByCustomization: ChartCustomization = {
     id: 'groupby-1',
     name: 'Group By',
     filterType: 'filter_groupby',
     type: ChartCustomizationType.ChartCustomization,
     targets: [{ datasetId: 1 }],
     scope: { rootPath: [], excluded: [] },
     controlValues: {},
     defaultDataMask: {},
   };
   ```



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