diff --git a/src/app/core/models/issue.model.ts b/src/app/core/models/issue.model.ts index 3a68e6bb0..8eac1cc80 100644 --- a/src/app/core/models/issue.model.ts +++ b/src/app/core/models/issue.model.ts @@ -13,6 +13,7 @@ import { TesterResponseTemplate } from './templates/tester-response-template.mod import { TutorModerationIssueTemplate } from './templates/tutor-moderation-issue-template.model'; import { TutorModerationTodoTemplate } from './templates/tutor-moderation-todo-template.model'; import { TesterResponse } from './tester-response.model'; +import { GITHUB_UI_EDIT_WARNING } from './templates/tester-response-template.model'; export class Issue { /** Basic Fields */ @@ -286,6 +287,8 @@ export class Issue { // Template url: https://github.com/CATcher-org/templates#teams-response-1 createGithubTesterResponse(): string { return ( + GITHUB_UI_EDIT_WARNING + + '\n' + `# Team\'s Response\n${this.teamResponse}\n` + `# Items for the Tester to Verify\n${this.getTesterResponsesString(this.testerResponses)}` ); diff --git a/src/app/core/models/templates/tester-response-template.model.ts b/src/app/core/models/templates/tester-response-template.model.ts index d5d2e0560..eae027c9e 100644 --- a/src/app/core/models/templates/tester-response-template.model.ts +++ b/src/app/core/models/templates/tester-response-template.model.ts @@ -63,7 +63,7 @@ interface TesterResponseParseResult { teamChosenType: string; } -const GITHUB_UI_EDIT_WARNING = +export const GITHUB_UI_EDIT_WARNING = // eslint-disable-next-line max-len '[IMPORTANT!: Please do not edit or reply to this comment using the GitHub UI. You can respond to it using CATcher during the next phase of the PE]'; const TESTER_RESPONSES_HEADER = '# Items for the Tester to Verify'; @@ -72,7 +72,7 @@ const DISAGREE_CHECKBOX_DESCRIPTION = 'I disagree'; const TeamResponseSectionParser = buildTeamResponseSectionParser(TESTER_RESPONSES_HEADER); export const TesterResponseParser = coroutine(function* () { - yield possibly(str(GITHUB_UI_EDIT_WARNING)); + yield str(GITHUB_UI_EDIT_WARNING); yield optionalWhitespace; const teamResponse = yield TeamResponseSectionParser; diff --git a/tests/model/issue.model.spec.ts b/tests/model/issue.model.spec.ts index 0c596b106..a636a7b39 100644 --- a/tests/model/issue.model.spec.ts +++ b/tests/model/issue.model.spec.ts @@ -116,14 +116,20 @@ describe('Issue', () => { phaseTesterResponseIssue.teamResponse = 'Sample Text'; phaseTesterResponseIssue.testerResponses = []; expect(phaseTesterResponseIssue.createGithubTesterResponse()).toEqual( - `# Team\'s Response\n${phaseTesterResponseIssue.teamResponse}\n` + `# Items for the Tester to Verify\n${''}` + `[IMPORTANT!: Please do not edit or reply to this comment using the GitHub UI. ` + + `You can respond to it using CATcher during the next phase of the PE]\n` + + `# Team\'s Response\n${phaseTesterResponseIssue.teamResponse}\n` + + `# Items for the Tester to Verify\n${''}` ); const phaseTesterResponseIssue2 = dummyIssueWithTeam.clone(Phase.phaseTesterResponse); phaseTesterResponseIssue2.teamResponse = 'Sample Text'; phaseTesterResponseIssue2.testerResponses = [newTesterResponse]; expect(phaseTesterResponseIssue2.createGithubTesterResponse()).toEqual( - `# Team\'s Response\n${phaseTesterResponseIssue.teamResponse}\n` + `# Items for the Tester to Verify\n${newTesterResponse.toString()}` + `[IMPORTANT!: Please do not edit or reply to this comment using the GitHub UI. ` + + `You can respond to it using CATcher during the next phase of the PE]\n` + + `# Team\'s Response\n${phaseTesterResponseIssue.teamResponse}\n` + + `# Items for the Tester to Verify\n${newTesterResponse.toString()}` ); });