diff --git a/e2e-tests/cypress/e2e/self-report/selfReport-approvalHistory_spec.js b/e2e-tests/cypress/e2e/self-report/selfReport-approvalHistory_spec.js index f12701aad..43df32a40 100644 --- a/e2e-tests/cypress/e2e/self-report/selfReport-approvalHistory_spec.js +++ b/e2e-tests/cypress/e2e/self-report/selfReport-approvalHistory_spec.js @@ -58,6 +58,7 @@ describe('Self Report Approval History Tests', () => { cy.createSkill(1, 1, 1, { selfReportingType: 'Approval' }); cy.createSkill(1, 1, 2, { selfReportingType: 'Approval' }); cy.createSkill(1, 1, 3, { selfReportingType: 'Approval' }); + cy.createSkill(1, 1, 4, { selfReportingType: 'Approval' }); // cy.reportSkill(1, 2, 'user6', '2020-09-11 11:00') // cy.reportSkill(1, 2, 'user5', '2020-09-12 11:00') // cy.reportSkill(1, 2, 'user4', '2020-09-13 11:00') @@ -68,9 +69,35 @@ describe('Self Report Approval History Tests', () => { cy.approveAllRequests(); cy.reportSkill(1, 2, 'user2', '2020-09-16 11:00'); cy.rejectRequest(0); + cy.reportSkill(1, 4, 'user2', '2024-09-16 11:00'); + cy.approveRequest(1, 0, 'I approve this message!'); cy.visit('/administrator/projects/proj1/self-report'); cy.validateTable(approvalHistoryTableSelector, [ + [ + { + colIndex: 0, + value: 'Very Great Skill 4' + }, { + colIndex: 0, + value: 'user2' + }, + { + colIndex: 1, + value: 'Approved' + }, { + colIndex: 1, + value: 'Explanation: I approve this message!' + }, + { + colIndex: 2, + value: '2024-09-16 11:00' + }, + { + colIndex: 3, + value: 'Today' + } + ], [ { colIndex: 0, diff --git a/e2e-tests/cypress/support/commands.js b/e2e-tests/cypress/support/commands.js index 307855cc9..652e2f45b 100644 --- a/e2e-tests/cypress/support/commands.js +++ b/e2e-tests/cypress/support/commands.js @@ -837,11 +837,12 @@ Cypress.Commands.add("reportSkill", (project = 1, skill = 1, userId = 'user@skil cy.doReportSkill({ project, skill, userId, date, failOnError, approvalRequestedMsg } ); }); -Cypress.Commands.add("approveRequest", (projNum = 1, requestNum = 0) => { +Cypress.Commands.add("approveRequest", (projNum = 1, requestNum = 0, approvalMsg = '') => { cy.request(`/admin/projects/proj${projNum}/approvals?limit=10&ascending=true&page=1&orderBy=userId`) .then((response) => { cy.request('POST', `/admin/projects/proj${projNum}/approvals/approve`, { skillApprovalIds: [response.body.data[requestNum].id], + approvalMessage: approvalMsg, }); }); });