Skip to content

Commit

Permalink
test: updated tests with the changes made
Browse files Browse the repository at this point in the history
  • Loading branch information
hussedev committed Jun 11, 2024
1 parent 95d8715 commit ddd81ff
Showing 1 changed file with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,14 @@ describe("<ViewRound /> in case of before the application start date", () => {
});
});

it("Should show grayed out Applications Open buttom", async () => {
it("Should show View Requirements Button", async () => {
renderWithContext(<ViewRound />, {
roundState: { rounds: [stubRound], isLoading: false },
dataLayer: mockDataLayer,
});

const AppSubmissionButton = screen.getByTestId("applications-open-button");
const AppSubmissionButton = screen.getByTestId("view-requirements-button");
expect(AppSubmissionButton).toBeInTheDocument();
expect(AppSubmissionButton).toBeDisabled();
});
});

Expand Down Expand Up @@ -154,24 +153,21 @@ describe("<ViewRound /> in case of during the application period", () => {
});

// expect that components / text / dates / etc. specific to application view page
expect(screen.getByText(stubRound.roundMetadata!.name)).toBeInTheDocument();
expect(screen.getAllByText(stubRound.roundMetadata!.name)).toHaveLength(2);
expect(screen.getByTestId("application-period")).toBeInTheDocument();
expect(screen.getByTestId("round-period")).toBeInTheDocument();
expect(screen.getByTestId("matching-funds")).toBeInTheDocument();
expect(
screen.getByText(stubRound.roundMetadata!.eligibility!.description)
).toBeInTheDocument();
expect(screen.getByTestId("round-eligibility")).toBeInTheDocument();
});

it("Should show apply to round button", async () => {
renderWithContext(<ViewRound />, {
roundState: { rounds: [stubRound], isLoading: false },
dataLayer: mockDataLayer,
});
const AppSubmissionButton = await screen.findAllByText(
"Apply to Grant Round"
);
const AppSubmissionButton = await screen.findAllByText("Apply now!");
expect(AppSubmissionButton[0]).toBeInTheDocument();
});
});
Expand All @@ -198,17 +194,15 @@ describe("<ViewRound /> in case of post application end date & before round star
});
});

it("Should show Applications Closed button", async () => {
it("Should show Donations countdown badge", async () => {
renderWithContext(<ViewRound />, {
roundState: { rounds: [stubRound], isLoading: false },
dataLayer: mockDataLayer,
});

const AppSubmissionButton = screen.getByTestId(
"applications-closed-button"
const DonationsBadge = await screen.getByTestId(
"donations-countdown-badge"
);
expect(AppSubmissionButton).toBeInTheDocument();
expect(AppSubmissionButton).toBeDisabled();
expect(DonationsBadge).toBeInTheDocument();
});
});

Expand Down

0 comments on commit ddd81ff

Please sign in to comment.