mirror of
https://github.com/apache/superset.git
synced 2026-06-05 15:49:27 +00:00
fix(explore): Prevent shared controls from checking feature flags outside React render (#21315)
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
import React from 'react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { FeatureFlag } from '@superset-ui/core';
|
||||
import {
|
||||
render,
|
||||
screen,
|
||||
@@ -67,6 +68,14 @@ const adhocMetricB = {
|
||||
optionName: 'def',
|
||||
};
|
||||
|
||||
beforeAll(() => {
|
||||
window.featureFlags = { [FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP]: true };
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
window.featureFlags = {};
|
||||
});
|
||||
|
||||
test('renders with default props', () => {
|
||||
render(<DndMetricSelect {...defaultProps} />, { useDnd: true });
|
||||
expect(screen.getByText('Drop column or metric here')).toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user