Skip to content

Commit

Permalink
chore: update jest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BCerki committed Sep 11, 2023
1 parent 1754fe2 commit 47d0549
Showing 1 changed file with 8 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -578,32 +578,15 @@ describe("The Project Funding Agreement Form Summary", () => {
return result;
},
});
componentTestingHelper.renderComponent();
componentTestingHelper.renderComponent(undefined, {
viewOnly: true,
});

expect(
screen.getByText(/budgets, expenses & payments not added/i)
).toBeInTheDocument();
});
it("Displays relevant message when funding agreement not updated", () => {
componentTestingHelper.loadQuery({
...mockQueryPayloadEP,
ProjectRevision() {
const result: Partial<ProjectFundingAgreementFormSummary_projectRevision$data> =
{
isFirstRevision: false,
summaryProjectFundingAgreementFormChanges: {
edges: [],
},
};
return result;
},
});
componentTestingHelper.renderComponent();

expect(
screen.getByText(/budgets, expenses & payments not updated/i)
).toBeInTheDocument();
});
it("Displays relevant message when funding agreement removed", () => {
componentTestingHelper.loadQuery({
...mockQueryPayloadEP,
Expand Down Expand Up @@ -648,10 +631,13 @@ describe("The Project Funding Agreement Form Summary", () => {
return result;
},
});
componentTestingHelper.renderComponent();
componentTestingHelper.renderComponent(undefined, {
isOnAmendmentsAndOtherRevisionsPage: true,
viewOnly: false,
});

expect(
screen.queryAllByText(/budgets, expenses & payments/i)[1]
screen.queryAllByText(/budgets, expenses & payments/i)[0]
).toHaveClass("diffOld");
});

Expand Down

0 comments on commit 47d0549

Please sign in to comment.