@@ -28,9 +28,7 @@ import {
2828}  from  '../schema-analysis-types' ; 
2929import  type  {  SchemaAnalysisState  }  from  '../schema-analysis-types' ; 
3030import  {  MockDataGeneratorStep  }  from  '../components/mock-data-generator-modal/types' ; 
31- import  type  {  MockDataGeneratorState  }  from  '../components/mock-data-generator-modal/types' ; 
3231import  {  CollectionActions  }  from  '../modules/collection-tab' ; 
33- import  {  type  MockDataSchemaResponse  }  from  '@mongodb-js/compass-generative-ai' ; 
3432
3533const  defaultMetadata  =  { 
3634  namespace : 'test.foo' , 
@@ -328,53 +326,11 @@ describe('Collection Tab Content store', function () {
328326      } ; 
329327
330328    describe ( 'on FakerMappingGenerationStarted' ,  function  ( )  { 
331-       it ( 'should not change state when analyis is incomplete; or schema generation request in progress or completed' ,  function  ( )  { 
332-         const  noOpStates : CollectionState [ ]  =  [ 
333-           {  ...baseState  } , 
334-           { 
335-             ...baseState , 
336-             schemaAnalysis : completeSchemaState , 
337-             mockDataGenerator : { 
338-               isModalOpen : false , 
339-               currentStep : MockDataGeneratorStep . SCHEMA_CONFIRMATION , 
340-             } , 
341-             fakerSchemaGeneration : { 
342-               status : 'in-progress' , 
343-               requestId : 'existing_id' , 
344-             } , 
345-           } , 
346-           { 
347-             ...baseState , 
348-             schemaAnalysis : completeSchemaState , 
349-             mockDataGenerator : { 
350-               isModalOpen : false , 
351-               currentStep : MockDataGeneratorStep . SCHEMA_CONFIRMATION , 
352-             } , 
353-             fakerSchemaGeneration : { 
354-               status : 'completed' , 
355-               fakerSchema : { 
356-                 content : { 
357-                   fields : [ 
358-                     { 
359-                       fieldPath : 'name' , 
360-                       probability : 1.0 , 
361-                       mongoType : 'string'  as  const , 
362-                       fakerMethod : 'person.firstName' , 
363-                       fakerArgs : [ ] , 
364-                       isArray : false , 
365-                     } , 
366-                   ] , 
367-                 } , 
368-               } , 
369-               requestId : 'existing_id' , 
370-             } , 
371-           } , 
372-         ] ; 
373- 
374-         noOpStates . forEach ( ( state )  =>  { 
375-           const  action  =  fakerMappingGenerationStartedAction ; 
376-           expect ( collectionTabReducer ( state ,  action ) ) . to . deep . equal ( state ) ; 
377-         } ) ; 
329+       it ( 'should not change state when analyis is incomplete' ,  function  ( )  { 
330+         const  action  =  fakerMappingGenerationStartedAction ; 
331+         expect ( collectionTabReducer ( {  ...baseState  } ,  action ) ) . to . deep . equal ( 
332+           baseState 
333+         ) ; 
378334      } ) ; 
379335
380336      it ( 'should update status to generating when conditions are met' ,  function  ( )  { 
@@ -424,45 +380,6 @@ describe('Collection Tab Content store', function () {
424380          requestId : 'test_request_id' , 
425381        } ; 
426382
427-       it ( 'should not transition to completed if in idle, completed, or error state' ,  function  ( )  { 
428-         const  noOpStates : MockDataGeneratorState [ ]  =  [ 
429-           {  status : 'idle'  } , 
430-           { 
431-             status : 'completed' , 
432-             fakerSchema : { 
433-               content : { 
434-                 fields : [ 
435-                   { 
436-                     fieldPath : 'name' , 
437-                     probability : 1.0 , 
438-                     mongoType : 'string'  as  const , 
439-                     fakerMethod : 'person.firstName' , 
440-                     fakerArgs : [ ] , 
441-                     isArray : false , 
442-                   } , 
443-                 ] , 
444-               } , 
445-             } , 
446-             requestId : 'existing_id' , 
447-           } , 
448-           { 
449-             status : 'error' , 
450-             error : 'Some error' , 
451-             requestId : 'error_request_id' , 
452-           } , 
453-         ] ; 
454- 
455-         noOpStates . forEach ( ( fakerSchemaGeneration )  =>  { 
456-           const  state : CollectionState  =  { 
457-             ...baseState , 
458-             fakerSchemaGeneration, 
459-           } ; 
460-           const  action  =  fakerMappingGenerationCompletedAction ; 
461- 
462-           expect ( collectionTabReducer ( state ,  action ) ) . to . deep . equal ( state ) ; 
463-         } ) ; 
464-       } ) ; 
465- 
466383      it ( 'should update status to completed when generation is in progress' ,  function  ( )  { 
467384        const  state : CollectionState  =  { 
468385          ...baseState , 
@@ -498,45 +415,6 @@ describe('Collection Tab Content store', function () {
498415          requestId : 'test_request_id' , 
499416        } ; 
500417
501-       it ( 'should not transition to error if in idle, completed, or error state' ,  function  ( )  { 
502-         const  noOpStates : MockDataGeneratorState [ ]  =  [ 
503-           {  status : 'idle'  } , 
504-           { 
505-             status : 'completed' , 
506-             fakerSchema : { 
507-               content : { 
508-                 fields : [ 
509-                   { 
510-                     fieldPath : 'name' , 
511-                     probability : 1.0 , 
512-                     mongoType : 'string'  as  const , 
513-                     fakerMethod : 'person.firstName' , 
514-                     fakerArgs : [ ] , 
515-                     isArray : false , 
516-                   } , 
517-                 ] , 
518-               } , 
519-             } , 
520-             requestId : 'existing_id' , 
521-           } , 
522-           { 
523-             status : 'error' , 
524-             error : 'Previous error' , 
525-             requestId : 'error_request_id' , 
526-           } , 
527-         ] ; 
528- 
529-         noOpStates . forEach ( ( fakerSchemaGeneration )  =>  { 
530-           const  state : CollectionState  =  { 
531-             ...baseState , 
532-             fakerSchemaGeneration, 
533-           } ; 
534-           const  action  =  fakerMappingGenerationFailedAction ; 
535- 
536-           expect ( collectionTabReducer ( state ,  action ) ) . to . deep . equal ( state ) ; 
537-         } ) ; 
538-       } ) ; 
539- 
540418      it ( 'should update status to error when generation is in progress' ,  function  ( )  { 
541419        const  state : CollectionState  =  { 
542420          ...baseState , 
0 commit comments