@@ -80,6 +80,11 @@ describe('Dynamic Sampling', function () {
8080
8181 expect ( ignoreHealthChecks ) . toBeEnabled ( ) ;
8282 expect ( ignoreHealthChecks ) . toBeChecked ( ) ;
83+
84+ // Prioritize transaction names is not available
85+ expect (
86+ screen . queryByRole ( 'checkbox' , { name : 'Prioritize transaction names' } )
87+ ) . not . toBeInTheDocument ( ) ;
8388 } ) ;
8489
8590 it ( 'renders disabled default UI, when user has not permission to edit' , async function ( ) {
@@ -174,4 +179,50 @@ describe('Dynamic Sampling', function () {
174179 } )
175180 ) ;
176181 } ) ;
182+
183+ it ( 'render and toggle "Prioritize transaction names" option' , function ( ) {
184+ const { project, organization} = initializeOrg ( {
185+ ...initializeOrg ( ) ,
186+ projects : [
187+ TestStubs . Project ( {
188+ dynamicSamplingBiases : [
189+ ...dynamicSamplingBiases ,
190+ { id : DynamicSamplingBiasType . BOOST_TRANSACTION_NAMES , active : false } ,
191+ ] ,
192+ } ) ,
193+ ] ,
194+ organization : {
195+ ...initializeOrg ( ) . organization ,
196+ features : [ ...ORG_FEATURES , 'dynamic-sampling-transaction-name-priority' ] ,
197+ } ,
198+ } ) ;
199+
200+ const mockRequests = renderMockRequests ( organization . slug , project . slug ) ;
201+
202+ render ( < DynamicSampling project = { project } /> , { organization} ) ;
203+
204+ const prioritizeTransactionNames = screen . getByRole ( 'checkbox' , {
205+ name : 'Prioritize transaction names' ,
206+ } ) ;
207+
208+ expect ( prioritizeTransactionNames ) . toBeEnabled ( ) ;
209+ expect ( prioritizeTransactionNames ) . not . toBeChecked ( ) ;
210+
211+ userEvent . click ( screen . getByRole ( 'checkbox' , { name : 'Prioritize transaction names' } ) ) ;
212+
213+ expect ( mockRequests . projectDetails ) . toHaveBeenCalledWith (
214+ `/projects/${ organization . slug } /${ project . slug } /` ,
215+ expect . objectContaining ( {
216+ data : {
217+ dynamicSamplingBiases : [
218+ { id : DynamicSamplingBiasType . BOOST_LATEST_RELEASES , active : true } ,
219+ { id : DynamicSamplingBiasType . BOOST_ENVIRONMENTS , active : true } ,
220+ { id : DynamicSamplingBiasType . BOOST_KEY_TRANSACTIONS , active : true } ,
221+ { id : DynamicSamplingBiasType . IGNORE_HEALTH_CHECKS , active : true } ,
222+ { id : DynamicSamplingBiasType . BOOST_TRANSACTION_NAMES , active : true } ,
223+ ] ,
224+ } ,
225+ } )
226+ ) ;
227+ } ) ;
177228} ) ;
0 commit comments