File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -287,4 +287,34 @@ describe('CollectionHeader [Component]', function () {
287287 } ) ;
288288 } ) ;
289289 } ) ;
290+
291+ context ( 'Mock Data Generator Modal' , function ( ) {
292+ it ( 'should close modal when cancel button is clicked' , function ( ) {
293+ const onCloseMockDataModal = Sinon . stub ( ) ;
294+
295+ renderCollectionHeader ( {
296+ isMockDataModalOpen : true ,
297+ onCloseMockDataModal,
298+ } ) ;
299+
300+ const cancelButton = screen . getByText ( 'Cancel' ) ;
301+ userEvent . click ( cancelButton ) ;
302+
303+ expect ( onCloseMockDataModal ) . to . have . been . calledOnce ;
304+ } ) ;
305+
306+ it ( 'should close modal when X button is clicked' , function ( ) {
307+ const onCloseMockDataModal = Sinon . stub ( ) ;
308+
309+ renderCollectionHeader ( {
310+ isMockDataModalOpen : true ,
311+ onCloseMockDataModal,
312+ } ) ;
313+
314+ const closeButton = screen . getByLabelText ( 'Close modal' ) ;
315+ userEvent . click ( closeButton ) ;
316+
317+ expect ( onCloseMockDataModal ) . to . have . been . calledOnce ;
318+ } ) ;
319+ } ) ;
290320} ) ;
You can’t perform that action at this time.
0 commit comments