Skip to content

Commit f07c59e

Browse files
committed
add test for deprecation
1 parent c226201 commit f07c59e

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

static/app/views/discover/savedQuery/datasetSelectorTabs.spec.tsx

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const EVENT_VIEW_CONSTRUCTOR_PROPS: EventViewOptions = {
2323
};
2424

2525
describe('Discover DatasetSelector', function () {
26-
const {router} = initializeOrg({
26+
const {router, organization} = initializeOrg({
2727
organization: {features: ['performance-view']},
2828
});
2929

@@ -121,4 +121,35 @@ describe('Discover DatasetSelector', function () {
121121
})
122122
);
123123
});
124+
125+
it('disables transactions dataset if org has deprecation feature', function () {
126+
const eventView = new EventView({
127+
...EVENT_VIEW_CONSTRUCTOR_PROPS,
128+
dataset: DiscoverDatasets.ERRORS,
129+
id: '1',
130+
});
131+
132+
const org = {
133+
...organization,
134+
features: [...organization.features, 'discover-saved-queries-deprecation'],
135+
};
136+
137+
render(
138+
<DatasetSelectorTabs
139+
isHomepage={false}
140+
savedQuery={undefined}
141+
eventView={eventView}
142+
/>,
143+
{
144+
router,
145+
organization: org,
146+
deprecatedRouterMocks: true,
147+
}
148+
);
149+
150+
expect(screen.getByRole('tab', {name: 'Transactions'})).toHaveAttribute(
151+
'aria-disabled',
152+
'true'
153+
);
154+
});
124155
});

0 commit comments

Comments
 (0)