@@ -33,6 +33,7 @@ const { data } = QUESTION_APP_SETTINGS.find(
3333
3434const id = data . questionId ;
3535const { choices } = data as MultipleChoicesAppSettingData ;
36+ const allChoicesIdx = choices . map ( ( _c , idx ) => idx ) ;
3637
3738const multipleChoiceAppSettingsData = APP_SETTINGS [ 0 ] . data as AppSettingData ;
3839
@@ -90,6 +91,13 @@ const checkCorrection = (selection: number[], showCorrection = true) => {
9091 }
9192} ;
9293
94+ const checkAllChoicesAreNotSelected = ( ) =>
95+ allChoicesIdx . forEach ( ( idx ) =>
96+ cy
97+ . get ( dataCyWrapper ( buildMultipleChoicesButtonCy ( idx , false ) ) )
98+ . should ( 'be.visible' )
99+ ) ;
100+
93101/**
94102 * Checks that the buttons inputs and submit buttons are disabled or not.
95103 * It is useful to check that:
@@ -306,6 +314,18 @@ describe('Play Multiple Choices', () => {
306314 } ) ;
307315 } ) ;
308316
317+ it ( 'Reset selection on retry' , ( ) => {
318+ const selection = [ 0 , 2 ] ;
319+
320+ clickSelection ( selection ) ;
321+
322+ cy . get ( dataCyWrapper ( PLAY_VIEW_SUBMIT_BUTTON_CY ) ) . click ( ) ;
323+ cy . get ( dataCyWrapper ( PLAY_VIEW_RETRY_BUTTON_CY ) ) . click ( ) ;
324+
325+ // Checks that the user's selection is reset on retry.
326+ checkAllChoicesAreNotSelected ( ) ;
327+ } ) ;
328+
309329 it ( 'Correct app data' , ( ) => {
310330 // click on choices -> become selected
311331 const selection = choices . reduce (
0 commit comments