You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "lyndsiWilliams (via GitHub)" <gi...@apache.org> on 2023/01/30 23:57:16 UTC

[GitHub] [superset] lyndsiWilliams commented on a diff in pull request #22915: test: Clean up AdhocFilterOption test warnings

lyndsiWilliams commented on code in PR #22915:
URL: https://github.com/apache/superset/pull/22915#discussion_r1091287474


##########
superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterOption/AdhocFilterOption.test.tsx:
##########
@@ -19,14 +19,35 @@
 import React from 'react';
 import { render, screen, waitFor } from 'spec/helpers/testing-library';
 import userEvent from '@testing-library/user-event';
-import { HTML5Backend } from 'react-dnd-html5-backend';
-import { DndProvider } from 'react-dnd';
 import AdhocFilter, {
   EXPRESSION_TYPES,
   CLAUSES,
 } from 'src/explore/components/controls/FilterControl/AdhocFilter';
 import AdhocFilterOption, { AdhocFilterOptionProps } from '.';
 
+jest.mock('src/components/Icons/Icon', () => ({
+  __esModule: true,
+  default: ({
+    fileName,
+    role,
+    iconColor,
+    ...rest
+  }: {
+    fileName: string;
+    role: string;
+    iconColor: string;
+  }) => (
+    <span
+      role={role ?? 'img'}
+      aria-label={fileName.replace('_', '-')}
+      // @ts-ignore

Review Comment:
   This is to prevent the following warning in the test:
   ```
   Warning: React does not recognize the `iconColor` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `iconcolor` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
           in span (created by default)
           ...
   ```
   
   This seemed arbitrary to the functionality so I felt it was safe to ignore.



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org