@@ -80,6 +80,11 @@ describe('Dynamic Sampling', function () {
8080
8181 expect ( ignoreHealthChecks ) . toBeEnabled ( ) ;
8282 expect ( ignoreHealthChecks ) . toBeChecked ( ) ;
83+
84+ // Prioritize low-volume transactions is not available
85+ expect (
86+ screen . queryByRole ( 'checkbox' , { name : 'Prioritize low-volume transactions' } )
87+ ) . not . toBeInTheDocument ( ) ;
8388 } ) ;
8489
8590 it ( 'renders disabled default UI, when user has not permission to edit' , async function ( ) {
@@ -174,4 +179,52 @@ describe('Dynamic Sampling', function () {
174179 } )
175180 ) ;
176181 } ) ;
182+
183+ it ( 'render and toggle "Prioritize low-volume transactions" option' , function ( ) {
184+ const { project, organization} = initializeOrg ( {
185+ ...initializeOrg ( ) ,
186+ projects : [
187+ TestStubs . Project ( {
188+ dynamicSamplingBiases : [
189+ ...dynamicSamplingBiases ,
190+ { id : DynamicSamplingBiasType . BOOST_LOW_VOLUME_TRANSACTIONS , 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 low-volume transactions' ,
206+ } ) ;
207+
208+ expect ( prioritizeTransactionNames ) . toBeEnabled ( ) ;
209+ expect ( prioritizeTransactionNames ) . not . toBeChecked ( ) ;
210+
211+ userEvent . click (
212+ screen . getByRole ( 'checkbox' , { name : 'Prioritize low-volume transactions' } )
213+ ) ;
214+
215+ expect ( mockRequests . projectDetails ) . toHaveBeenCalledWith (
216+ `/projects/${ organization . slug } /${ project . slug } /` ,
217+ expect . objectContaining ( {
218+ data : {
219+ dynamicSamplingBiases : [
220+ { id : DynamicSamplingBiasType . BOOST_LATEST_RELEASES , active : true } ,
221+ { id : DynamicSamplingBiasType . BOOST_ENVIRONMENTS , active : true } ,
222+ { id : DynamicSamplingBiasType . BOOST_KEY_TRANSACTIONS , active : true } ,
223+ { id : DynamicSamplingBiasType . IGNORE_HEALTH_CHECKS , active : true } ,
224+ { id : DynamicSamplingBiasType . BOOST_LOW_VOLUME_TRANSACTIONS , active : true } ,
225+ ] ,
226+ } ,
227+ } )
228+ ) ;
229+ } ) ;
177230} ) ;
0 commit comments