diff --git a/dashboard/src/components/skills/selfReport/SelfReportApproval.vue b/dashboard/src/components/skills/selfReport/SelfReportApproval.vue index 59bec7e1f..c487a6ec8 100644 --- a/dashboard/src/components/skills/selfReport/SelfReportApproval.vue +++ b/dashboard/src/components/skills/selfReport/SelfReportApproval.vue @@ -251,7 +251,7 @@ const toggleRow = (row) => {
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 0c9aee336..38f49bbe8 100644 --- a/e2e-tests/cypress/e2e/self-report/selfReport-approvalHistory_spec.js +++ b/e2e-tests/cypress/e2e/self-report/selfReport-approvalHistory_spec.js @@ -979,7 +979,41 @@ describe('Self Report Approval History Tests', () => { }); - it('approval history - expand multiple justifications', () => { + it('pending approval table - expand multiple justifications', () => { + cy.createSkill(1, 1, 1, { selfReportingType: 'Approval' }); + cy.reportSkill(1, 1, 'user1', '2020-09-17 11:00', true, 'please approve request 1'); + // cy.rejectRequest(); + cy.reportSkill(1, 1, 'user2', moment.utc(), true, 'please approve request 2'); + // cy.approveAllRequests(); + + cy.intercept('/admin/projects/proj1/approvals/history*') + .as('loadHistory'); + + cy.visit('/administrator/projects/proj1/self-report'); + cy.wait('@loadHistory'); + + cy.get('[data-cy="skillsReportApprovalTable"] [data-cy="expandDetailsBtn_skill1"]') + .should('have.length', 2) + .eq(0) + .click(); + + cy.get('[data-cy="skillsReportApprovalTable"] [data-cy="expandDetailsBtn_skill1"]') + .should('have.length', 2) + .eq(1) + .click(); + + cy.get('[data-cy="skillsReportApprovalTable"] [data-cy="approvalMessage"]') + .should('have.length', 2) + .eq(0) + .should('contain.text', 'please approve request 2') + + cy.get('[data-cy="skillsReportApprovalTable"] [data-cy="approvalMessage"]') + .should('have.length', 2) + .eq(1) + .should('contain.text', 'please approve request 1'); + }); + + it('approval history table - expand multiple justifications', () => { cy.createSkill(1, 1, 1, { selfReportingType: 'Approval' }); cy.reportSkill(1, 1, 'user1', '2020-09-17 11:00', true, 'please approve request 1'); cy.rejectRequest(); @@ -992,22 +1026,22 @@ describe('Self Report Approval History Tests', () => { cy.visit('/administrator/projects/proj1/self-report'); cy.wait('@loadHistory'); - cy.get('[data-cy="expandDetailsBtn_skill1"]') + cy.get('[data-cy="selfReportApprovalHistoryTable"] [data-cy="expandDetailsBtn_skill1"]') .should('have.length', 2) .eq(0) .click(); - cy.get('[data-cy="expandDetailsBtn_skill1"]') + cy.get('[data-cy="selfReportApprovalHistoryTable"] [data-cy="expandDetailsBtn_skill1"]') .should('have.length', 2) .eq(1) .click(); - cy.get('[data-cy="approvalMessage"]') + cy.get('[data-cy="selfReportApprovalHistoryTable"] [data-cy="approvalMessage"]') .should('have.length', 2) .eq(0) .should('contain.text', 'please approve request 2') - cy.get('[data-cy="approvalMessage"]') + cy.get('[data-cy="selfReportApprovalHistoryTable"] [data-cy="approvalMessage"]') .should('have.length', 2) .eq(1) .should('contain.text', 'please approve request 1');