mirror of
https://github.com/apache/superset.git
synced 2026-04-14 05:34:38 +00:00
feat(dashboard): menu improvements, fallback support for Drill to Detail (#21351)
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
import { getMockStore } from 'spec/fixtures/mockStore';
|
||||
import { render, screen } from 'spec/helpers/testing-library';
|
||||
import { FeatureFlag } from 'src/featureFlags';
|
||||
import SliceHeaderControls, { SliceHeaderControlsProps } from '.';
|
||||
@@ -96,9 +97,11 @@ const createProps = (viz_type = 'sunburst') =>
|
||||
|
||||
const renderWrapper = (overrideProps?: SliceHeaderControlsProps) => {
|
||||
const props = overrideProps || createProps();
|
||||
const store = getMockStore();
|
||||
return render(<SliceHeaderControls {...props} />, {
|
||||
useRedux: true,
|
||||
useRouter: true,
|
||||
store,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -253,6 +256,7 @@ test('Should show the "Drill to detail"', () => {
|
||||
[FeatureFlag.DRILL_TO_DETAIL]: true,
|
||||
};
|
||||
const props = createProps();
|
||||
props.slice.slice_id = 18;
|
||||
renderWrapper(props);
|
||||
expect(screen.getByText('Drill to detail')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user