geido commented on code in PR #30697:
URL: https://github.com/apache/superset/pull/30697#discussion_r1815359468


##########
superset-frontend/src/dashboard/components/SliceAdder.test.tsx:
##########
@@ -16,37 +16,48 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import { shallow } from 'enzyme';
+import { shallow, ShallowWrapper } from 'enzyme';
 import sinon from 'sinon';
 
 import SliceAdder, {
   ChartList,
   DEFAULT_SORT_KEY,
+  SliceAdderProps,
 } from 'src/dashboard/components/SliceAdder';
 import { sliceEntitiesForDashboard as mockSliceEntities } from 
'spec/fixtures/mockSliceEntities';
 import { styledShallow } from 'spec/helpers/theming';
 
-jest.mock('lodash/debounce', () => fn => {
-  // eslint-disable-next-line no-param-reassign
-  fn.throttle = jest.fn();
-  return fn;
-});
+jest.mock(
+  'lodash/debounce',
+  () => (fn: { throttle: jest.Mock<any, any, any> }) => {
+    // eslint-disable-next-line no-param-reassign
+    fn.throttle = jest.fn();
+    return fn;
+  },
+);
 
 describe('SliceAdder', () => {
-  const props = {
-    ...mockSliceEntities,
+  const props: SliceAdderProps = {
+    slices: {
+      ...mockSliceEntities.slices,
+    },
     fetchSlices: jest.fn(),
     updateSlices: jest.fn(),
     selectedSliceIds: [127, 128],
     userId: 1,
+    dashboardId: 0,
+    editMode: false,
+    errorMessage: '',
+    isLoading: false,
+    lastUpdated: 0,
   };
   const errorProps = {
     ...props,
     errorMessage: 'this is error',
   };
-
   describe('SliceAdder.sortByComparator', () => {
     it('should sort by timestamp descending', () => {
+      console.log(Object.values(props.slices));

Review Comment:
   ```suggestion
   ```



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