@@ -47,7 +47,7 @@ public void setUp() throws Exception {
47
47
super .setUp ();
48
48
configureRestoreFactory ("caseclaimdomain" , "caseclaimusername" );
49
49
storageFactoryMock .configure ("user" , "domain" , "app_id" , "asUser" );
50
- FormPlayerPropertyManagerMock .mockAutoAdvanceMenu (storageFactoryMock );
50
+ FormPlayerPropertyManagerMock .mockAutoAdvanceMenu (storageFactoryMock , true );
51
51
}
52
52
53
53
@ Override
@@ -275,20 +275,34 @@ public void testPersistentMenuWithAutoSelect() throws Exception {
275
275
expectedMenu .add (new PersistentCommand ("1" , "Case List" , null , NavIconState .NEXT ));
276
276
expectedMenu .add (new PersistentCommand ("2" , "Menu with Auto Submit Form" , null , NavIconState .NEXT ));
277
277
expectedMenu .add (new PersistentCommand ("3" , "Single Form Auto Select" , null , NavIconState .NEXT ));
278
+ PersistentCommand firstMenu = expectedMenu .get (0 );
279
+ firstMenu .addCommand (new PersistentCommand ("0" ,"Registration Form" , null , NavIconState .JUMP ));
280
+ firstMenu .addCommand (new PersistentCommand ("1" ,"Followup Form" , null , NavIconState .JUMP ));
281
+ firstMenu .addCommand (new PersistentCommand ("2" ,"Followup Form with AutoSelect Datum" , "jr://file/commcare/image/m0f2customicon_en.png" , NavIconState .NEXT ));
282
+ firstMenu .addCommand (new PersistentCommand ("3" ,"Followup Form with AutoSelect Datum" , null , NavIconState .NEXT ));
283
+ String [] selections = new String []{"0" , "2" };
284
+ NewFormResponse formResponse = sessionNavigate (selections , APP , NewFormResponse .class );
285
+ assertEquals (expectedMenu , formResponse .getPersistentMenu ());
286
+ }
287
+
288
+ @ Test
289
+ public void testPersistentMenuWithAutoAdvance () throws Exception {
290
+ ArrayList <PersistentCommand > expectedMenu = new ArrayList <>();
291
+ expectedMenu .add (new PersistentCommand ("0" , "Case List" , "jr://file/commcare/image/m0customicon_en.png" , NavIconState .NEXT ));
292
+ expectedMenu .add (new PersistentCommand ("1" , "Case List" , null , NavIconState .NEXT ));
293
+ expectedMenu .add (new PersistentCommand ("2" , "Menu with Auto Submit Form" , null , NavIconState .NEXT ));
294
+ expectedMenu .add (new PersistentCommand ("3" , "Single Form Auto Select" , null , NavIconState .NEXT ));
278
295
279
296
// Auto-Advance in a Auto Select Case List
280
297
String [] selections = new String []{"3" };
281
298
NewFormResponse formResponse = sessionNavigate (selections , APP , NewFormResponse .class );
282
299
assertEquals (expectedMenu , formResponse .getPersistentMenu ());
283
300
284
-
285
- PersistentCommand firstMenu = expectedMenu .get (0 );
286
- firstMenu .addCommand (new PersistentCommand ("0" ,"Registration Form" , null , NavIconState .JUMP ));
287
- firstMenu .addCommand (new PersistentCommand ("1" ,"Followup Form" , null , NavIconState .JUMP ));
288
- firstMenu .addCommand (new PersistentCommand ("2" ,"Followup Form with AutoSelect Datum" , "jr://file/commcare/image/m0f2customicon_en.png" , NavIconState .NEXT ));
289
- firstMenu .addCommand (new PersistentCommand ("3" ,"Followup Form with AutoSelect Datum" , null , NavIconState .NEXT ));
290
- selections = new String []{"0" , "2" };
301
+ FormPlayerPropertyManagerMock .mockAutoAdvanceMenu (storageFactoryMock , false );
302
+ selections = new String []{"3" , "0" };
291
303
formResponse = sessionNavigate (selections , APP , NewFormResponse .class );
304
+ expectedMenu .get (3 ).addCommand (new PersistentCommand ("0" , "Followup Form with AutoSelect Datum" ,
305
+ "jr://file/commcare/image/m0f2customicon_en.png" , NavIconState .JUMP ));
292
306
assertEquals (expectedMenu , formResponse .getPersistentMenu ());
293
307
}
294
308
}
0 commit comments