@@ -223,119 +223,6 @@ describe('CollectionHeaderActions [Component]', function () {
223223 } ,
224224 } ;
225225
226- it ( 'should not show Mock Data Generator button when user is in control group' , async function ( ) {
227- mockUseAssignment . returns ( {
228- assignment : {
229- assignmentData : {
230- variant : 'mockDataGeneratorControl' ,
231- } ,
232- } ,
233- } ) ;
234-
235- await renderCollectionHeaderActions (
236- {
237- namespace : 'test.collection' ,
238- isReadonly : false ,
239- } ,
240- { } ,
241- atlasConnectionInfo
242- ) ;
243-
244- expect (
245- screen . queryByTestId ( 'collection-header-generate-mock-data-button' )
246- ) . to . not . exist ;
247- } ) ;
248-
249- it ( 'should not show Mock Data Generator button when not in Atlas' , async function ( ) {
250- mockUseAssignment . returns ( {
251- assignment : {
252- assignmentData : {
253- variant : 'treatment' ,
254- } ,
255- } ,
256- } ) ;
257-
258- await renderCollectionHeaderActions ( {
259- namespace : 'test.collection' ,
260- isReadonly : false ,
261- // Don't pass atlasConnectionInfo, to simulate not being in Atlas
262- } ) ;
263-
264- expect (
265- screen . queryByTestId ( 'collection-header-generate-mock-data-button' )
266- ) . to . not . exist ;
267- } ) ;
268-
269- it ( 'should not show Mock Data Generator button for readonly collections' , async function ( ) {
270- mockUseAssignment . returns ( {
271- assignment : {
272- assignmentData : {
273- variant : 'treatment' ,
274- } ,
275- } ,
276- } ) ;
277-
278- await renderCollectionHeaderActions (
279- {
280- namespace : 'test.collection' ,
281- isReadonly : true ,
282- } ,
283- { } ,
284- atlasConnectionInfo
285- ) ;
286-
287- expect (
288- screen . queryByTestId ( 'collection-header-generate-mock-data-button' )
289- ) . to . not . exist ;
290- } ) ;
291-
292- it ( 'should not show Mock Data Generator button for views (sourceName present)' , async function ( ) {
293- mockUseAssignment . returns ( {
294- assignment : {
295- assignmentData : {
296- variant : 'treatment' ,
297- } ,
298- } ,
299- } ) ;
300-
301- await renderCollectionHeaderActions (
302- {
303- namespace : 'test.collection' ,
304- isReadonly : false ,
305- sourceName : 'source-collection' ,
306- } ,
307- { } ,
308- atlasConnectionInfo
309- ) ;
310-
311- expect (
312- screen . queryByTestId ( 'collection-header-generate-mock-data-button' )
313- ) . to . not . exist ;
314- } ) ;
315-
316- it ( 'should show Mock Data Generator button when user is in treatment group and in Atlas' , async function ( ) {
317- mockUseAssignment . returns ( {
318- assignment : {
319- assignmentData : {
320- variant : 'mockDataGeneratorVariant' ,
321- } ,
322- } ,
323- } ) ;
324-
325- await renderCollectionHeaderActions (
326- {
327- namespace : 'test.collection' ,
328- isReadonly : false ,
329- } ,
330- { } ,
331- atlasConnectionInfo
332- ) ;
333-
334- expect (
335- screen . getByTestId ( 'collection-header-generate-mock-data-button' )
336- ) . to . exist ;
337- } ) ;
338-
339226 it ( 'should call useAssignment with correct parameters' , async function ( ) {
340227 await renderCollectionHeaderActions ( {
341228 namespace : 'test.collection' ,
@@ -376,80 +263,5 @@ describe('CollectionHeaderActions [Component]', function () {
376263
377264 expect ( onOpenMockDataModal ) . to . have . been . calledOnce ;
378265 } ) ;
379-
380- it ( 'should disable Mock Data Generator button when hasSchemaAnalysisData is false' , async function ( ) {
381- mockUseAssignment . returns ( {
382- assignment : {
383- assignmentData : {
384- variant : 'mockDataGeneratorVariant' ,
385- } ,
386- } ,
387- } ) ;
388-
389- await renderCollectionHeaderActions (
390- {
391- namespace : 'test.collection' ,
392- isReadonly : false ,
393- hasSchemaAnalysisData : false ,
394- } ,
395- { } ,
396- atlasConnectionInfo
397- ) ;
398-
399- const button = screen . getByTestId (
400- 'collection-header-generate-mock-data-button'
401- ) ;
402- expect ( button ) . to . have . attribute ( 'aria-disabled' , 'true' ) ;
403- } ) ;
404-
405- it ( 'should enable Mock Data Generator button when hasSchemaAnalysisData is true' , async function ( ) {
406- mockUseAssignment . returns ( {
407- assignment : {
408- assignmentData : {
409- variant : 'mockDataGeneratorVariant' ,
410- } ,
411- } ,
412- } ) ;
413-
414- await renderCollectionHeaderActions (
415- {
416- namespace : 'test.collection' ,
417- isReadonly : false ,
418- hasSchemaAnalysisData : true ,
419- } ,
420- { } ,
421- atlasConnectionInfo
422- ) ;
423-
424- const button = screen . getByTestId (
425- 'collection-header-generate-mock-data-button'
426- ) ;
427- expect ( button ) . to . not . have . attribute ( 'aria-disabled' , 'true' ) ;
428- } ) ;
429-
430- it ( 'should not show Mock Data Generator button for collections with excessive nesting depth' , async function ( ) {
431- mockUseAssignment . returns ( {
432- assignment : {
433- assignmentData : {
434- variant : 'mockDataGeneratorVariant' ,
435- } ,
436- } ,
437- } ) ;
438-
439- await renderCollectionHeaderActions (
440- {
441- namespace : 'test.collection' ,
442- isReadonly : false ,
443- hasSchemaAnalysisData : true ,
444- analyzedSchemaDepth : 4 , // Exceeds the limit of 3
445- } ,
446- { } ,
447- atlasConnectionInfo
448- ) ;
449-
450- expect (
451- screen . queryByTestId ( 'collection-header-generate-mock-data-button' )
452- ) . to . not . exist ;
453- } ) ;
454266 } ) ;
455267} ) ;
0 commit comments