diff --git a/superset-frontend/packages/superset-core/src/utils/logging.test.ts b/superset-frontend/packages/superset-core/src/utils/logging.test.ts index ead6d292b4f..d1c7c32d187 100644 --- a/superset-frontend/packages/superset-core/src/utils/logging.test.ts +++ b/superset-frontend/packages/superset-core/src/utils/logging.test.ts @@ -16,13 +16,24 @@ * specific language governing permissions and limitations * under the License. */ +type LoggingModule = typeof import('./index'); + +const loadLogging = (): LoggingModule['logging'] => { + let logging: LoggingModule['logging'] | undefined; + jest.isolateModules(() => { + ({ logging } = jest.requireActual( + '@apache-superset/core/utils', + )); + }); + return logging!; +}; + beforeEach(() => { - jest.resetModules(); jest.resetAllMocks(); }); test('should pipe to `console` methods', () => { - const { logging } = require('@apache-superset/core/utils'); + const logging = loadLogging(); jest.spyOn(logging, 'debug').mockImplementation(); jest.spyOn(logging, 'log').mockImplementation(); @@ -53,7 +64,7 @@ test('should use noop functions when console unavailable', () => { const originalConsole = window.console; Object.assign(window, { console: undefined }); try { - const { logging } = require('@apache-superset/core/utils'); + const logging = loadLogging(); expect(() => { logging.debug(); diff --git a/superset-frontend/packages/superset-ui-core/src/components/Avatar/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Avatar/index.tsx index 1e11c774d60..3bd7c591b81 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Avatar/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Avatar/index.tsx @@ -25,8 +25,15 @@ export const Avatar = forwardRef((props, ref) => ( )); -export const AvatarGroup = (props: AvatarGroupProps) => ( - +// antd Avatar.Group is a plain function component without forwardRef; wrap in +// a span so this component can be a Tooltip / Popover trigger and skip the +// findDOMNode fallback. +export const AvatarGroup = forwardRef( + (props, ref) => ( + + + + ), ); export type { AvatarProps, AvatarGroupProps };