Add some more sophisticated scouting tests
This patch adds a test that validates actually submitting a match.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I3fb1063b5ec89aa843d0bb96f71c3bbfd2601122
diff --git a/scouting/www/app.ts b/scouting/www/app.ts
index 18f08d4..e34283a 100644
--- a/scouting/www/app.ts
+++ b/scouting/www/app.ts
@@ -29,8 +29,10 @@
switchTabTo(tab: Tab) {
let shouldSwitch = true;
- if (tab === 'ImportMatchList') {
- shouldSwitch = window.confirm('Leave data scouting page?');
+ if (this.tab !== tab) {
+ if (!this.block_alerts.nativeElement.checked) {
+ shouldSwitch = window.confirm('Leave current page?');
+ }
}
if (shouldSwitch) {
this.tab = tab;
diff --git a/scouting/www/entry/entry.component.ts b/scouting/www/entry/entry.component.ts
index 9a4caa6..412306a 100644
--- a/scouting/www/entry/entry.component.ts
+++ b/scouting/www/entry/entry.component.ts
@@ -88,6 +88,8 @@
}
async submitDataScouting() {
+ this.errorMessage = '';
+
const builder = new flatbuffer_builder.Builder() as unknown as flatbuffers.Builder;
SubmitDataScouting.startSubmitDataScouting(builder);
SubmitDataScouting.addTeam(builder, this.teamNumber);
diff --git a/scouting/www/import_match_list/import_match_list.component.ts b/scouting/www/import_match_list/import_match_list.component.ts
index 7ad4ab6..bb7e73e 100644
--- a/scouting/www/import_match_list/import_match_list.component.ts
+++ b/scouting/www/import_match_list/import_match_list.component.ts
@@ -21,8 +21,12 @@
errorMessage: string = '';
async importMatchList() {
- if (!window.confirm('Actually import new matches?')) {
- return;
+ const block_alerts = document.getElementById('block_alerts') as HTMLInputElement;
+ console.log(block_alerts.checked);
+ if (!block_alerts.checked) {
+ if (!window.confirm('Actually import new matches?')) {
+ return;
+ }
}
this.errorMessage = '';