Skip to content

Commit

Permalink
test: expand tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-Heneghan committed Mar 15, 2024
1 parent e83566f commit 4ee7a5e
Showing 1 changed file with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,62 @@ describe("SubmissionsTable renders as expected", () => {
expect(getByText("Email Applications")).toBeInTheDocument();
});

test("renders the session ids", () => {
const { getByText } = setup(
<SubmissionsTable applications={mockApplications} />,
);

mockApplications.forEach((app) => {
expect(getByText(app.sessionId)).toBeInTheDocument();
});
});

test("renders payment request ids when available", () => {
const { getByText } = setup(
<SubmissionsTable applications={mockApplications} />,
);

expect(getByText(/test-payment-request-2/)).toBeInTheDocument();
expect(getByText(/test-payment-request-1/)).toBeInTheDocument();
});

test("renders the latest payment status for each session", () => {
const { getAllByText } = setup(
<SubmissionsTable applications={mockApplications} />,
);

expect(getAllByText(/Status: created/)).toHaveLength(3);
expect(getAllByText(/Status: error/)).toHaveLength(1);
expect(getAllByText(/Status: success/)).toHaveLength(2);
});

test("renders bops application ids when available", () => {
const { getByText } = setup(
<SubmissionsTable applications={mockApplications} />,
);

expect(getByText(/test-bops-1/)).toBeInTheDocument();
});

test("renders uniform application ids when available", () => {
const { getByText } = setup(
<SubmissionsTable applications={mockApplications} />,
);

expect(getByText(/test-uniform-1/)).toBeInTheDocument();
expect(getByText(/test-uniform-2/)).toBeInTheDocument();
});

test("renders email application recipients when available", () => {
const { getByText } = setup(
<SubmissionsTable applications={mockApplications} />,
);

expect(getByText(/[email protected]/)).toBeInTheDocument();
expect(getByText(/[email protected]/)).toBeInTheDocument();
expect(getByText(/[email protected]/)).toBeInTheDocument();
});

test("renders with no accessibility violations", async () => {
const { container } = setup(
<SubmissionsTable applications={mockApplications} />,
Expand Down

0 comments on commit 4ee7a5e

Please sign in to comment.