Skip to content

Commit

Permalink
#3088 - added unique instance-id prop to markdown-text
Browse files Browse the repository at this point in the history
  • Loading branch information
rmmayo committed Jan 15, 2025
1 parent c493c7e commit 64035e6
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ const toggleRow = (row) => {
<div>
<Card v-if="slotProps.data.requestMsg && slotProps.data.requestMsg.length > 0" header="Requested points with the following justification:" class="ml-4">
<template #content>
<markdown-text class="d-inline-block" :text="slotProps.data.requestMsg" data-cy="approvalMessage"/>
<markdown-text class="d-inline-block" :text="slotProps.data.requestMsg" data-cy="approvalMessage" :instance-id="`${slotProps.data.id}`"/>
</template>
</Card>
<Card v-else>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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');
Expand Down

0 comments on commit 64035e6

Please sign in to comment.