Skip to content
127 changes: 98 additions & 29 deletions apps/e2e/cypress/e2e/FAPs.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,75 @@ context('Fap reviews tests', () => {
'1'
);
});

it('Should be able to see the Reviewers to Assignments view', () => {
cy.assignProposalsToFaps({
fapInstruments: [
{ instrumentId: newlyCreatedInstrumentId, fapId: createdFapId },
],
proposalPks: [firstCreatedProposalPk],
});
cy.assignReviewersToFap({
fapId: createdFapId,
memberIds: [fapMembers.reviewer.id],
});
cy.assignFapReviewersToProposals({
assignments: {
memberId: fapMembers.reviewer.id,
proposalPk: firstCreatedProposalPk,
},
fapId: createdFapId,
});

cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.finishedLoading();

cy.contains(fapMembers.reviewer.lastName).should('be.visible');

cy.get('[aria-label="Detail panel visibility toggle"]').first().click();
cy.contains(firstCreatedProposalId).should('be.visible');
});

it.only('Should be able to assign proposals to reviewers in the Reviewers to Assignments view', () => {
cy.assignProposalsToFaps({
fapInstruments: [
{ instrumentId: newlyCreatedInstrumentId, fapId: createdFapId },
],
proposalPks: [firstCreatedProposalPk],
});
cy.assignReviewersToFap({
fapId: createdFapId,
memberIds: [fapMembers.reviewer.id],
});

cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.finishedLoading();

cy.contains(fapMembers.reviewer.lastName)
.parent()
.find('input[type="checkbox"]')
.click();

cy.get('[data-cy="assign-proposals-to-member"]').click();

cy.get('[role="dialog"]').contains('Proposals to assign to reviewer');

cy.contains(firstCreatedProposalId)
.parent()
.find('input[type="checkbox"]')
.click();

cy.get('[data-cy="assign-selected-proposals"]').click();

clickConfirmOk();

cy.contains('0 / 1').should('be.visible');

cy.get('[aria-label="Detail panel visibility toggle"]').first().click();
cy.contains(firstCreatedProposalId).should('be.visible');
});
});

describe('Fap Chair role', () => {
Expand Down Expand Up @@ -2219,7 +2288,7 @@ context('Fap meeting components tests', () => {
describe('User Officer role', () => {
it('Officer should be able to assign proposal to instrument and instrument to call to see it in meeting components', () => {
cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand Down Expand Up @@ -2248,7 +2317,7 @@ context('Fap meeting components tests', () => {

it('Officer should not be able to submit an instrument if all proposals are not submitted in Fap meetings', () => {
cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand Down Expand Up @@ -2316,7 +2385,7 @@ context('Fap meeting components tests', () => {
});

cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand Down Expand Up @@ -2374,7 +2443,7 @@ context('Fap meeting components tests', () => {
}
});
cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand Down Expand Up @@ -2529,7 +2598,7 @@ context('Fap meeting components tests', () => {
}
});
cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand All @@ -2549,7 +2618,7 @@ context('Fap meeting components tests', () => {

it('Officer should be able to see proposals that are marked red if they do not fit in availability time', () => {
cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand All @@ -2561,7 +2630,7 @@ context('Fap meeting components tests', () => {

it('Officer should be able to update avaliblity time', () => {
cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand All @@ -2575,7 +2644,7 @@ context('Fap meeting components tests', () => {

it('Officer should be able to edit Fap Meeting form', () => {
cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand Down Expand Up @@ -2641,7 +2710,7 @@ context('Fap meeting components tests', () => {
);

cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand Down Expand Up @@ -2746,7 +2815,7 @@ context('Fap meeting components tests', () => {
});

cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand Down Expand Up @@ -2807,7 +2876,7 @@ context('Fap meeting components tests', () => {
});

cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand Down Expand Up @@ -2871,7 +2940,7 @@ context('Fap meeting components tests', () => {
});

cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand Down Expand Up @@ -2907,7 +2976,7 @@ context('Fap meeting components tests', () => {

it('Officer should be able to set Fap time allocation', () => {
cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand Down Expand Up @@ -2959,7 +3028,7 @@ context('Fap meeting components tests', () => {
it('should use Fap time allocation (if set) when calculating if they fit in available time', () => {
const newFapTimeAllocation = 15;
cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand Down Expand Up @@ -3111,7 +3180,7 @@ context('Fap meeting components tests', () => {
});

cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand Down Expand Up @@ -3144,7 +3213,7 @@ context('Fap meeting components tests', () => {

it('Officer should be able to submit an instrument if all proposals Fap meetings are submitted in existing Fap', () => {
cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand Down Expand Up @@ -3260,7 +3329,7 @@ context('Fap meeting components tests', () => {
fapId: createdFapId,
});
cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand All @@ -3278,7 +3347,7 @@ context('Fap meeting components tests', () => {

it('Download Fap is working with dialog window showing up', () => {
cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand Down Expand Up @@ -3515,7 +3584,7 @@ context('Fap meeting components tests', () => {
cy.changeActiveRole(initialDBData.roles.fapChair);
});
it('Fap Chair should be able to edit Fap Meeting form', () => {
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand Down Expand Up @@ -3543,7 +3612,7 @@ context('Fap meeting components tests', () => {
instrumentId: createdInstrumentId,
fapId: createdFapId,
});
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();
cy.get('button[aria-label="Submit instrument"]').should('not.exist');
Expand Down Expand Up @@ -3578,7 +3647,7 @@ context('Fap meeting components tests', () => {

it('Fap Chair should be able to update avalibabity time', () => {
cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand Down Expand Up @@ -3710,7 +3779,7 @@ context('Fap meeting components tests', () => {

cy.login(fapMembers.chair);
cy.changeActiveRole(initialDBData.roles.fapChair);
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand Down Expand Up @@ -3749,7 +3818,7 @@ context('Fap meeting components tests', () => {
});

it('Fap Secretary should be able to edit Fap Meeting form', () => {
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand Down Expand Up @@ -3777,7 +3846,7 @@ context('Fap meeting components tests', () => {
instrumentId: createdInstrumentId,
fapId: createdFapId,
});
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();
cy.get('button[aria-label="Submit instrument"]').should('not.exist');
Expand Down Expand Up @@ -3812,7 +3881,7 @@ context('Fap meeting components tests', () => {

it('Fap Secretary should be able to update avalibabity time', () => {
cy.login('officer');
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand Down Expand Up @@ -3944,7 +4013,7 @@ context('Fap meeting components tests', () => {

cy.login(fapMembers.secretary);
cy.changeActiveRole(initialDBData.roles.fapSecretary);
cy.visit(`/FapPage/${createdFapId}?tab=4`);
cy.visit(`/FapPage/${createdFapId}?tab=5`);

cy.finishedLoading();

Expand Down Expand Up @@ -4690,7 +4759,7 @@ context('Fap meeting exports test', () => {
});

cy.login('officer');
cy.visit('/FapPage/2?tab=4&call=1');
cy.visit('/FapPage/2?tab=5&call=1');

cy.get('button[aria-label="Export in Excel"]').click();
cy.get('[data-cy=preparing-download-dialog').should('not.exist');
Expand Down Expand Up @@ -4757,7 +4826,7 @@ context('Fap meeting exports test', () => {
}
});
cy.login('officer');
cy.visit('/FapPage/2?tab=4&call=1');
cy.visit('/FapPage/2?tab=5&call=1');

cy.get('button[aria-label="Export in Excel"]').click();
cy.get('[data-cy=preparing-download-dialog').should('not.exist');
Expand Down Expand Up @@ -4832,7 +4901,7 @@ context('Fap meeting exports test', () => {
});

cy.login('officer');
cy.visit('/FapPage/2?tab=4&call=1');
cy.visit('/FapPage/2?tab=5&call=1');

cy.get('button[aria-label="Export in Excel"]').click();
cy.get('[data-cy=preparing-download-dialog').should('not.exist');
Expand Down
12 changes: 6 additions & 6 deletions apps/e2e/cypress/e2e/generalFaps.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ context('General facility access panel tests', () => {
const fileName1 = 'pdf_5_pages.pdf';
const fileName2 = 'pdf_3_pages.pdf';
cy.login('officer');
cy.visit(`/FapPage/1?tab=6`);
cy.visit(`/FapPage/1?tab=7`);

cy.intercept({
method: 'POST',
Expand Down Expand Up @@ -767,7 +767,7 @@ context('General facility access panel tests', () => {
cy.contains(fileName2).should('exist');

// Files persist after reload
cy.visit(`/FapPage/1?tab=6`);
cy.visit(`/FapPage/1?tab=7`);

cy.contains(fileName1).should('exist');
cy.contains(fileName2).should('exist');
Expand All @@ -778,7 +778,7 @@ context('General facility access panel tests', () => {
cy.contains(fileName2).should('not.exist');

// Files removed after reload
cy.visit(`/FapPage/1?tab=6`);
cy.visit(`/FapPage/1?tab=7`);

cy.contains(fileName1).should('not.exist');
cy.contains(fileName2).should('not.exist');
Expand All @@ -803,7 +803,7 @@ context('General facility access panel tests', () => {
const fileName1 = 'pdf_5_pages.pdf';

cy.login('officer');
cy.visit(`/FapPage/1?tab=6`);
cy.visit(`/FapPage/1?tab=7`);

cy.intercept({
method: 'POST',
Expand Down Expand Up @@ -848,7 +848,7 @@ context('General facility access panel tests', () => {
const fileName1 = 'pdf_5_pages.pdf';

cy.login('officer');
cy.visit(`/FapPage/1?tab=6`);
cy.visit(`/FapPage/1?tab=7`);

cy.intercept({
method: 'POST',
Expand Down Expand Up @@ -890,7 +890,7 @@ context('General facility access panel tests', () => {
const fileName1 = 'pdf_5_pages.pdf';

cy.login('officer');
cy.visit(`/FapPage/1?tab=6`);
cy.visit(`/FapPage/1?tab=7`);

cy.intercept({
method: 'POST',
Expand Down
Loading
Loading