@@ -228,6 +228,39 @@ describe('MockDataGeneratorModal', () => {
228228 // todo: assert that closing then re-opening the modal after an LLM err removes the err message
229229 } ) ;
230230
231+ describe ( 'on the generate data step' , ( ) => {
232+ it ( 'enables the Back button' , ( ) => {
233+ renderModal ( { currentStep : MockDataGeneratorStep . GENERATE_DATA } ) ;
234+
235+ expect (
236+ screen
237+ . getByRole ( 'button' , { name : 'Back' } )
238+ . getAttribute ( 'aria-disabled' )
239+ ) . to . not . equal ( 'true' ) ;
240+ } ) ;
241+
242+ it ( 'renders the main sections: Prerequisites, steps, and Resources' , ( ) => {
243+ renderModal ( { currentStep : MockDataGeneratorStep . GENERATE_DATA } ) ;
244+
245+ expect ( screen . getByText ( 'Prerequisites' ) ) . to . exist ;
246+ expect ( screen . getByText ( '1. Create a .js file with the following script' ) )
247+ . to . exist ;
248+ expect ( screen . getByText ( '2. Run the script with' ) ) . to . exist ;
249+ expect ( screen . getByText ( 'Resources' ) ) . to . exist ;
250+ } ) ;
251+
252+ it ( 'closes the modal when the Done button is clicked' , async ( ) => {
253+ renderModal ( { currentStep : MockDataGeneratorStep . GENERATE_DATA } ) ;
254+
255+ expect ( screen . getByTestId ( 'generate-mock-data-modal' ) ) . to . exist ;
256+ userEvent . click ( screen . getByText ( 'Done' ) ) ;
257+ await waitFor (
258+ ( ) =>
259+ expect ( screen . queryByTestId ( 'generate-mock-data-modal' ) ) . to . not . exist
260+ ) ;
261+ } ) ;
262+ } ) ;
263+
231264 describe ( 'when rendering the modal in a specific step' , ( ) => {
232265 const steps = Object . keys (
233266 StepButtonLabelMap
0 commit comments