Skip to content

Commit

Permalink
Merge branch 'master' into SWAP-4325-scicat-frontend-implement-custom…
Browse files Browse the repository at this point in the history
…izable-dataset-d
  • Loading branch information
Junjiequan authored Feb 3, 2025
2 parents 9c3df68 + aed9710 commit 4459c22
Show file tree
Hide file tree
Showing 30 changed files with 3,023 additions and 2,820 deletions.
42 changes: 42 additions & 0 deletions cypress/e2e/proposals/proposals-general.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,47 @@ describe("Proposals general", () => {
matchCase: true,
});
});

it("should be able to see and click related proposals on a proposal", () => {
const newProposal = {
...testData.proposal,
proposalId: Math.floor(100000 + Math.random() * 900000).toString(),
parentProposalId: proposal.proposalId,
};
const newProposal2 = {
...testData.proposal,
proposalId: Math.floor(100000 + Math.random() * 900000).toString(),
parentProposalId: newProposal.proposalId,
};
cy.createProposal(newProposal);
cy.createProposal(newProposal2);

cy.visit("/proposals");

cy.get("mat-table mat-header-row").should("exist");

cy.finishedLoading();

cy.get("mat-table mat-row").should("contain", newProposal.proposalId);
cy.get("mat-table mat-row").should("contain", newProposal2.proposalId);

cy.get("mat-row")
.contains(newProposal.proposalId)
.parent()
.contains(newProposal.title)
.click();

cy.url().should("include", `/proposals/${newProposal.proposalId}`);

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

cy.get('[data-cy="related-proposals-table"] mat-row')
.contains(newProposal2.title)
.parent()
.contains("child");
cy.get('[data-cy="related-proposals-table"] mat-row')
.contains(proposal.title)
.click();
});
});
});
Loading

0 comments on commit 4459c22

Please sign in to comment.