Skip to content

Commit

Permalink
Revert "test: update jest tests"
Browse files Browse the repository at this point in the history
This reverts commit e29afc8.
  • Loading branch information
BCerki committed Sep 11, 2023
1 parent fe286c2 commit f394717
Showing 1 changed file with 50 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -564,42 +564,47 @@ describe("The Project Funding Agreement Form Summary", () => {
).toBeInTheDocument();
});

it("Displays relevant message on summary page when funding agreement not added", () => {
it("Displays relevant message when funding agreement not added", () => {
componentTestingHelper.loadQuery({
...mockQueryPayloadEP,
ProjectRevision() {
const result: Partial<ProjectFundingAgreementFormSummary_projectRevision$data> =
{
isFirstRevision: false,
projectFormChange: {
asProject: {
fundingStreamRfpByFundingStreamRfpId: {
fundingStreamByFundingStreamId: {
name: "EP",
},
},
},
},
isFirstRevision: true,
summaryProjectFundingAgreementFormChanges: {
edges: [],
},
latestCommittedFundingFormChanges: {
edges: [],
},
};
return result;
},
});
componentTestingHelper.renderComponent(undefined, {
viewOnly: true,
});
componentTestingHelper.renderComponent();

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();

it("Displays correct diffs when funding agreement removed", () => {
expect(
screen.getByText(/budgets, expenses & payments not updated/i)
).toBeInTheDocument();
});
it("Displays relevant message when funding agreement removed", () => {
componentTestingHelper.loadQuery({
...mockQueryPayloadEP,
ProjectRevision() {
Expand All @@ -609,61 +614,31 @@ describe("The Project Funding Agreement Form Summary", () => {
summaryProjectFundingAgreementFormChanges: {
edges: [
{
newFormData: {
projectId: 2,
proponentCost: 245,
maxFundingAmount: 23,
contractStartDate: "2023-08-30T23:59:59.999-07:00",
holdbackPercentage: 10,
provinceSharePercentage: 50,
anticipatedFundingAmount: 246,
projectAssetsLifeEndDate: "2023-09-14T23:59:59.999-07:00",
},
eligibleExpensesToDate: "1.00",
holdbackAmountToDate: "0.10",
netPaymentsToDate: "1.00",
grossPaymentsToDate: "1.00",
calculatedTotalPaymentAmountToDate: "18.4",
proponentsSharePercentage: "91.41791044776119403000",
totalProjectValue: "268",
anticipatedFundingAmountPerFiscalYear: {
edges: [
{
node: {
anticipatedFundingAmount: "1",
fiscalYear: "2023/2024",
},
},
],
},
operation: "ARCHIVE",
formChangeByPreviousFormChangeId: {
node: {
newFormData: {
projectId: 2,
proponentCost: 245,
maxFundingAmount: 23,
contractStartDate: "2023-08-30T23:59:59.999-07:00",
holdbackPercentage: 10,
provinceSharePercentage: 50,
anticipatedFundingAmount: 246,
projectAssetsLifeEndDate: "2023-09-14T23:59:59.999-07:00",
projectId: "Test Project ID",
maxFundingAmount: 200,
provinceSharePercentage: 60,
holdbackPercentage: 20.15,
anticipatedFundingAmount: 300,
proponentCost: 100,
contractStartDate: "2021-02-02T23:59:59.999-07:00",
projectAssetsLifeEndDate: "2021-12-31T23:59:59.999-07:00",
},
eligibleExpensesToDate: "1.00",
holdbackAmountToDate: "0.10",
netPaymentsToDate: "1.00",
grossPaymentsToDate: "1.00",
calculatedTotalPaymentAmountToDate: "18.4",
proponentsSharePercentage: "91.41791044776119403000",
totalProjectValue: "268",
anticipatedFundingAmountPerFiscalYear: {
edges: [
{
node: {
anticipatedFundingAmount: "1",
fiscalYear: "2023/2024",
},
},
],
isPristine: false,
operation: "ARCHIVE",
formChangeByPreviousFormChangeId: {
newFormData: {
projectId: "Test Project ID",
maxFundingAmount: 200,
provinceSharePercentage: 50,
holdbackPercentage: 10.23,
anticipatedFundingAmount: 300,
proponentCost: 100,
contractStartDate: "2021-01-01T23:59:59.999-07:00",
projectAssetsLifeEndDate:
"2021-12-31T23:59:59.999-07:00",
},
},
},
},
Expand All @@ -673,13 +648,11 @@ describe("The Project Funding Agreement Form Summary", () => {
return result;
},
});
componentTestingHelper.renderComponent(undefined, {
isOnAmendmentsAndOtherRevisionsPage: true,
});
componentTestingHelper.renderComponent();

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

it("renders the tooltips for the EP form", () => {
Expand Down

0 comments on commit f394717

Please sign in to comment.