Scouting app: fix action submission
In the Review screen, ending the teleop phase showed up as "9" since it was not caught in the switch case in entry.ng.html. Additionally, if
the scout switched between the endgame and review screen multiple times,
there would be multiple penalty actions since the penalty action created
when they went to the review page would not be deleted when they go back
to the endgame screen. This patch addresses these problems.
Signed-off-by: Emily Markova <emily.markova@gmail.com>
Change-Id: I7db2f93a74691e04a0d4290c19de927eabf8b802
diff --git a/scouting/scouting_test.cy.js b/scouting/scouting_test.cy.js
index 2727104..990e69f 100644
--- a/scouting/scouting_test.cy.js
+++ b/scouting/scouting_test.cy.js
@@ -102,7 +102,12 @@
cy.contains(/Harmony/).click();
clickButton('End Match');
+
+ clickButton('UNDO');
+ clickButton('End Match');
+
headerShouldBe(teamNumber + ' Review and Submit ');
+
cy.get('#review_data li')
.eq(0)
.should('have.text', ' Started match at position 1 ');
@@ -113,6 +118,8 @@
'have.text',
' Ended Match; stageType: kHARMONY, trapNote: false, spotlight: false '
);
+ // Ensure that the penalties action is only submitted once.
+ cy.get('#review_data li').contains('Penalties').should('have.length', 1);
clickButton('Submit');
headerShouldBe(teamNumber + ' Success ');