@@ -144,7 +144,7 @@ describe("BENEFICIAL OWNER DELETE WARNING controller", () => {
144144 } ) ;
145145
146146 describe ( "POST tests" , ( ) => {
147- test ( "redirects to the beneficial owner type page if No option has been selected" , async ( ) => {
147+ test ( "redirects to the beneficial owner type page if No option has been selected and REDIS_removal flag is set to OFF " , async ( ) => {
148148 const resp = await request ( app )
149149 . post ( config . BENEFICIAL_OWNER_DELETE_WARNING_URL )
150150 . send ( { delete_beneficial_owners : "0" } ) ;
@@ -157,7 +157,21 @@ describe("BENEFICIAL OWNER DELETE WARNING controller", () => {
157157 expect ( mockUpdateOverseasEntity ) . not . toHaveBeenCalled ( ) ;
158158 } ) ;
159159
160- test ( `redirects to the beneficial owner type page if Yes option has been selected and REDIS_removal flag is set to ON and
160+ test ( "redirects to the beneficial owner type page if No option has been selected and REDIS_removal flag is set to ON" , async ( ) => {
161+ const resp = await request ( app )
162+ . post ( config . BENEFICIAL_OWNER_DELETE_WARNING_WITH_PARAMS_URL )
163+ . send ( { delete_beneficial_owners : "0" } ) ;
164+ mockIsActiveFeature . mockReturnValueOnce ( true ) ;
165+ mockIsActiveFeature . mockReturnValueOnce ( true ) ;
166+ expect ( resp . status ) . toEqual ( 302 ) ;
167+ expect ( resp . header . location ) . toEqual ( config . BENEFICIAL_OWNER_STATEMENTS_URL ) ;
168+ expect ( mockSetExtraData ) . not . toHaveBeenCalled ( ) ;
169+ expect ( mockCheckBOsDetailsEntered ) . not . toHaveBeenCalled ( ) ;
170+ expect ( mockCheckMOsDetailsEntered ) . not . toHaveBeenCalled ( ) ;
171+ expect ( mockUpdateOverseasEntity ) . not . toHaveBeenCalled ( ) ;
172+ } ) ;
173+
174+ test ( `redirects to the beneficial owner type page if Yes option has been selected when REDIS_removal flag is set to ON and
161175 ${ BeneficialOwnersStatementType . SOME_IDENTIFIED_ALL_DETAILS } as statement type` , async ( ) => {
162176
163177 mockFetchApplicationData . mockReturnValueOnce ( APPLICATION_DATA_MOCK ) ;
0 commit comments