@@ -462,6 +462,8 @@ describe('approval controller', () => {
462462
463463 describe ( 'get' , ( ) => {
464464 it ( 'gets entry' , ( ) => {
465+ // We only want to test the stored entity in the controller state hence disabling floating promises here.
466+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
465467 approvalController . add ( {
466468 id : 'foo' ,
467469 origin : 'bar.baz' ,
@@ -481,7 +483,13 @@ describe('approval controller', () => {
481483 } ) ;
482484
483485 it ( 'returns undefined for non-existing entry' , ( ) => {
484- approvalController . add ( { id : 'foo' , origin : 'bar.baz' , type : 'type' } ) ;
486+ // We only want to test the stored entity in the controller state hence disabling floating promises here.
487+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
488+ approvalController . add ( {
489+ id : 'foo' ,
490+ origin : 'bar.baz' ,
491+ type : 'type' ,
492+ } ) ;
485493
486494 expect ( approvalController . get ( 'fizz' ) ) . toBeUndefined ( ) ;
487495
@@ -495,8 +503,9 @@ describe('approval controller', () => {
495503 let addWithCatch : ( args : any ) => void ;
496504
497505 beforeEach ( ( ) => {
498- addWithCatch = ( args : any ) =>
506+ addWithCatch = ( args : any ) => {
499507 approvalController . add ( args ) . catch ( ( ) => undefined ) ;
508+ } ;
500509 } ) ;
501510
502511 it ( 'validates input' , ( ) => {
@@ -627,8 +636,9 @@ describe('approval controller', () => {
627636 it ( 'gets the total approval count' , ( ) => {
628637 expect ( approvalController . getTotalApprovalCount ( ) ) . toBe ( 0 ) ;
629638
630- const addWithCatch = ( args : any ) =>
639+ const addWithCatch = ( args : any ) => {
631640 approvalController . add ( args ) . catch ( ( ) => undefined ) ;
641+ } ;
632642
633643 addWithCatch ( { id : '1' , origin : 'origin1' , type : 'type0' } ) ;
634644 expect ( approvalController . getTotalApprovalCount ( ) ) . toBe ( 1 ) ;
@@ -654,8 +664,9 @@ describe('approval controller', () => {
654664 } ) ;
655665 expect ( approvalController . getTotalApprovalCount ( ) ) . toBe ( 0 ) ;
656666
657- const addWithCatch = ( args : any ) =>
667+ const addWithCatch = ( args : any ) => {
658668 approvalController . add ( args ) . catch ( ( ) => undefined ) ;
669+ } ;
659670
660671 addWithCatch ( { id : '1' , origin : 'origin1' , type : 'type0' } ) ;
661672 expect ( approvalController . getTotalApprovalCount ( ) ) . toBe ( 1 ) ;
@@ -698,8 +709,14 @@ describe('approval controller', () => {
698709 ) . toThrow ( getInvalidHasTypeError ( ) ) ;
699710 } ) ;
700711
701- it ( 'returns true for existing entry by id' , ( ) => {
702- approvalController . add ( { id : 'foo' , origin : 'bar.baz' , type : TYPE } ) ;
712+ it ( 'returns true for existing entry by id' , async ( ) => {
713+ // We only want to check the stored entity is exist in the state hence disabling floating promises here.
714+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
715+ approvalController . add ( {
716+ id : 'foo' ,
717+ origin : 'bar.baz' ,
718+ type : TYPE ,
719+ } ) ;
703720
704721 expect ( approvalController . has ( { id : 'foo' } ) ) . toBe ( true ) ;
705722 } ) ;
0 commit comments