Skip to content

Commit

Permalink
feat(End-to-End Tests):
Browse files Browse the repository at this point in the history
  - remove a report from an activity

  related issues: #148 #149
  • Loading branch information
zPereiraa committed Jul 13, 2024
1 parent 28b303d commit 35a4a86
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/views/admin/AdminActivitiesView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<template v-slot:[`item.state`]="{ item }">
<v-chip
v-if="item.state === 'REPORTED'"
class="clickable"
class="button"
color="blue"
data-cy="reportedButton"
@click="openReportsDialog(item)"
Expand Down
38 changes: 38 additions & 0 deletions frontend/tests/e2e/specs/reports/reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,42 @@ describe('Report', () => {

});

it('delete a report', () => {
const JUSTIFICATION = 'Justification Exampe';

// first volunteer create an report
cy.demoVolunteerLogin()
cy.get('[data-cy="volunteerActivities"]').click();
cy.get('[data-cy="volunteerActivitiesTable"] tbody tr')
.eq(0)
.find('[data-cy="reportButton"]').click();
cy.get('[data-cy="justificationInput"]').type(JUSTIFICATION);
cy.get('[data-cy="saveReport"]').click()

// volunteer delete the report and checks that is APPROVED again

cy.get('[data-cy="volunteerActivitiesTable"] tbody tr')
.eq(0)
.find('[data-cy="UnReportButton"]').click();

cy.get('[data-cy="volunteerActivitiesTable"] tbody tr')
.eq(0)
.children()
.eq(6)
.should('contain', "APPROVED")

cy.logout();

// admin login and check that the activity is APPROVED
cy.demoAdminLogin()

cy.get('[data-cy="admin"]').click();
cy.get('[data-cy="adminActivities"]').click();
cy.get('[data-cy="adminActivitiesTable"] tbody tr')
.eq(0)
.children()
.eq(11)
.should('contain', "APPROVED")

});
});

0 comments on commit 35a4a86

Please sign in to comment.