Prevent scouts from scouting a non-existent match
We used to let people enter arbitrary match information, but the web
server rejects that information. It's better when we don't let people
enter arbitrary match information. This patch makes it so the "Next"
button is disabled on the "Team Selection" screen unless the match
information is correct.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I9203d04ab3c95ece4d84ede1042b2bac85e02936
diff --git a/scouting/scouting_test.cy.js b/scouting/scouting_test.cy.js
index 365b19e..3087454 100644
--- a/scouting/scouting_test.cy.js
+++ b/scouting/scouting_test.cy.js
@@ -96,14 +96,26 @@
cy.get('.badge').eq(89).contains('Final 1 Match 3');
});
- it('should: be let users enter match information manually.', () => {
+ it('should: prevent users from enter invalid match information.', () => {
+ switchToTab('Entry');
+ headerShouldBe(' Team Selection ');
+
+ setInputTo('#match_number', '1');
+ setInputTo('#team_number', '5254');
+ setInputTo('#set_number', '1');
+ cy.get('#comp_level').select('Qualifications');
+
+ cy.contains('button', 'Next').should('be.disabled');
+ });
+
+ it('should: let users enter match information manually.', () => {
switchToTab('Entry');
headerShouldBe(' Team Selection ');
setInputTo('#match_number', '3');
setInputTo('#team_number', '5254');
setInputTo('#set_number', '2');
- setInputTo('#comp_level', '3: sf');
+ cy.get('#comp_level').select('Semi Finals');
clickButton('Next');