diff --git a/static/app/views/issueDetails/groupDistributions/tagExportDropdown.spec.tsx b/static/app/views/issueDetails/groupDistributions/tagExportDropdown.spec.tsx new file mode 100644 index 00000000000000..ec5b5760f7ec2d --- /dev/null +++ b/static/app/views/issueDetails/groupDistributions/tagExportDropdown.spec.tsx @@ -0,0 +1,42 @@ +import {GroupFixture} from 'sentry-fixture/group'; +import {OrganizationFixture} from 'sentry-fixture/organization'; +import {ProjectFixture} from 'sentry-fixture/project'; + +import {render, screen} from 'sentry-test/reactTestingLibrary'; + +import TagExportDropdown from 'sentry/views/issueDetails/groupDistributions/tagExportDropdown'; + +describe('TagExportDropdown', function () { + const group = GroupFixture(); + const project = ProjectFixture(); + const orgWithFeature = OrganizationFixture({features: ['discover-query']}); + const orgWithoutFeature = OrganizationFixture({features: []}); + + it('does not render when org lacks discover-query feature', function () { + render( + , + {organization: orgWithoutFeature} + ); + + expect(screen.queryByLabelText('Export options')).not.toBeInTheDocument(); + }); + + it('renders when org has discover-query feature', function () { + render( + , + {organization: orgWithFeature} + ); + + expect(screen.getByLabelText('Export options')).toBeInTheDocument(); + }); +}); diff --git a/static/app/views/issueDetails/groupDistributions/tagExportDropdown.tsx b/static/app/views/issueDetails/groupDistributions/tagExportDropdown.tsx index 62e138826fd6da..b918d4a89d0296 100644 --- a/static/app/views/issueDetails/groupDistributions/tagExportDropdown.tsx +++ b/static/app/views/issueDetails/groupDistributions/tagExportDropdown.tsx @@ -1,5 +1,6 @@ import {useState} from 'react'; +import Feature from 'sentry/components/acl/feature'; import {Button} from 'sentry/components/core/button'; import {ExportQueryType, useDataExport} from 'sentry/components/dataExport'; import {DropdownMenu} from 'sentry/components/dropdownMenu'; @@ -30,39 +31,41 @@ export default function TagExportDropdown({tagKey, group, organization, project} }); return ( - ( -