Просмотр исходного кода

feat: simplify personal questionnaire publishing

Developer 1 месяц назад
Родитель
Сommit
22e216b254
2 измененных файлов с 15 добавлено и 1 удалено
  1. 1 1
      pagesPublish/fillTeamInfo.vue
  2. 14 0
      tests/personalPublishFlow.test.js

+ 1 - 1
pagesPublish/fillTeamInfo.vue

@@ -115,7 +115,7 @@
 						setTeamSubmissionStage(this.creationState, 'pcSession')
 						await this.$refs.teamRef.waitForDeferredPcUpload(teamId)
 					}
-					if(this.next && this.creationState.backgroundSurveyStatus !== 'COMPLETED'){
+					if(this.next && this.type != 1 && this.creationState.backgroundSurveyStatus !== 'COMPLETED'){
 						setTeamSubmissionStage(this.creationState, 'coachSurvey')
 						this.openCoachBackgroundSurvey(teamId)
 						return

+ 14 - 0
tests/personalPublishFlow.test.js

@@ -0,0 +1,14 @@
+const assert = require('assert');
+const fs = require('fs');
+
+const source = fs.readFileSync('pagesPublish/fillTeamInfo.vue', 'utf8');
+
+assert.match(
+  source,
+  /if\(this\.next && this\.type != 1 && this\.creationState\.backgroundSurveyStatus !== 'COMPLETED'\)/
+);
+assert.match(source, /this\.openCoachBackgroundSurvey\(teamId\)/);
+assert.match(source, /if\(this\.next && !this\.creationState\.teamQuestionnaireId\)/);
+assert.match(source, /url:backgroundIntroUrl\(/);
+
+console.log('personalPublishFlow.test.js: all assertions passed');