@@ -159,6 +159,7 @@ describe('Port List Component tests', () => {
159
159
const saveButton = getDialogSaveButton ( ) ;
160
160
fireEvent . click ( saveButton ) ;
161
161
await wait ( ) ;
162
+
162
163
expect ( screen . queryByText ( 'New Port List' ) ) . not . toBeInTheDocument ( ) ;
163
164
expect ( onCreated ) . toHaveBeenCalledWith ( newPortList ) ;
164
165
expect ( onCreateError ) . not . toHaveBeenCalled ( ) ;
@@ -324,7 +325,7 @@ describe('Port List Component tests', () => {
324
325
const savePortListButton = getDialogSaveButton ( portListDialog ) ;
325
326
fireEvent . click ( savePortListButton ) ;
326
327
await wait ( ) ;
327
- expect ( createPortRange ) . toHaveBeenCalledWith ( {
328
+ expect ( createPortRange ) . toHaveBeenCalledExactlyOnceWith ( {
328
329
end : 20 ,
329
330
entityType : 'portrange' ,
330
331
id : '123' ,
@@ -335,7 +336,7 @@ describe('Port List Component tests', () => {
335
336
port_type : 'tcp' ,
336
337
protocol_type : 'tcp' ,
337
338
} ) ;
338
- expect ( save ) . toHaveBeenCalledWith ( {
339
+ expect ( save ) . toHaveBeenCalledExactlyOnceWith ( {
339
340
comment : '' ,
340
341
from_file : 0 ,
341
342
id : '123' ,
@@ -352,7 +353,7 @@ describe('Port List Component tests', () => {
352
353
} ,
353
354
] ,
354
355
} ) ;
355
- expect ( onSaved ) . toHaveBeenCalledWith ( portList ) ;
356
+ expect ( onSaved ) . toHaveBeenCalledExactlyOnceWith ( portList ) ;
356
357
expect ( onSaveError ) . not . toHaveBeenCalled ( ) ;
357
358
expect ( onInteraction ) . toHaveBeenCalled ( ) ;
358
359
expect ( screen . queryByText ( 'Edit Port List foo' ) ) . not . toBeInTheDocument ( ) ;
@@ -410,18 +411,20 @@ describe('Port List Component tests', () => {
410
411
const savePortListButton = getDialogSaveButton ( ) ;
411
412
fireEvent . click ( savePortListButton ) ;
412
413
await wait ( ) ;
413
- expect ( deletePortRange ) . toHaveBeenCalledWith ( portList . port_ranges [ 0 ] ) ;
414
- expect ( onSaveError ) . not . toHaveBeenCalled ( ) ;
415
414
416
- expect ( save ) . toHaveBeenCalledWith ( {
415
+ expect ( deletePortRange ) . toHaveBeenCalledExactlyOnceWith (
416
+ portList . port_ranges [ 0 ] ,
417
+ ) ;
418
+ expect ( onSaveError ) . not . toHaveBeenCalled ( ) ;
419
+ expect ( save ) . toHaveBeenCalledExactlyOnceWith ( {
417
420
comment : '' ,
418
421
from_file : 0 ,
419
422
id : '123' ,
420
423
name : 'foo' ,
421
424
port_range : 'T:1-5,7,9,U:1-3,5,7,9' ,
422
425
port_ranges : [ ] ,
423
426
} ) ;
424
- expect ( onSaved ) . toHaveBeenCalledWith ( portList ) ;
427
+ expect ( onSaved ) . toHaveBeenCalledExactlyOnceWith ( portList ) ;
425
428
expect ( onInteraction ) . toHaveBeenCalled ( ) ;
426
429
expect ( screen . queryByText ( 'Edit Port List foo' ) ) . not . toBeInTheDocument ( ) ;
427
430
} ) ;
@@ -460,9 +463,10 @@ describe('Port List Component tests', () => {
460
463
const saveButton = getDialogSaveButton ( ) ;
461
464
fireEvent . click ( saveButton ) ;
462
465
await wait ( ) ;
466
+
463
467
expect ( screen . queryByText ( 'Edit Port List foo' ) ) . not . toBeInTheDocument ( ) ;
464
468
expect ( onSaved ) . not . toHaveBeenCalled ( ) ;
465
- expect ( onSaveError ) . toHaveBeenCalledWith ( error ) ;
469
+ expect ( onSaveError ) . toHaveBeenCalledExactlyOnceWith ( error ) ;
466
470
expect ( onInteraction ) . toHaveBeenCalled ( ) ;
467
471
} ) ;
468
472
@@ -528,7 +532,7 @@ describe('Port List Component tests', () => {
528
532
529
533
fireEvent . click ( screen . getByTestId ( 'button' ) ) ;
530
534
await wait ( ) ;
531
- expect ( onCloned ) . toHaveBeenCalledWith ( cloned ) ;
535
+ expect ( onCloned ) . toHaveBeenCalledExactlyOnceWith ( cloned ) ;
532
536
expect ( onCloneError ) . not . toHaveBeenCalled ( ) ;
533
537
expect ( onInteraction ) . toHaveBeenCalledOnce ( ) ;
534
538
} ) ;
@@ -559,7 +563,7 @@ describe('Port List Component tests', () => {
559
563
560
564
fireEvent . click ( screen . getByTestId ( 'button' ) ) ;
561
565
await wait ( ) ;
562
- expect ( onCloneError ) . toHaveBeenCalledWith ( error ) ;
566
+ expect ( onCloneError ) . toHaveBeenCalledExactlyOnceWith ( error ) ;
563
567
expect ( onCloned ) . not . toHaveBeenCalled ( ) ;
564
568
expect ( onInteraction ) . toHaveBeenCalledOnce ( ) ;
565
569
} ) ;
@@ -619,7 +623,7 @@ describe('Port List Component tests', () => {
619
623
620
624
fireEvent . click ( screen . getByTestId ( 'button' ) ) ;
621
625
await wait ( ) ;
622
- expect ( onDeleteError ) . toHaveBeenCalledWith ( error ) ;
626
+ expect ( onDeleteError ) . toHaveBeenCalledExactlyOnceWith ( error ) ;
623
627
expect ( onDeleted ) . not . toHaveBeenCalled ( ) ;
624
628
expect ( onInteraction ) . toHaveBeenCalledOnce ( ) ;
625
629
} ) ;
0 commit comments