feat(dashboard): menu improvements, fallback support for Drill to Detail (#21351)

This commit is contained in:
Cody Leff
2022-10-19 15:34:46 -06:00
committed by GitHub
parent 54f6fd6a82
commit 76e57ec651
56 changed files with 969 additions and 310 deletions

View File

@@ -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();
});