Skip to content

Commit

Permalink
test: add basic testing for SubmissionsTable
Browse files Browse the repository at this point in the history
- With the complex data testing the values render as expected has been strenuous
- Could be a good candidate for parameterization or snapshot testing potentially
- Will revisit when the table view is more stable
  • Loading branch information
Mike-Heneghan committed Mar 15, 2024
1 parent e7c2022 commit e83566f
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from "react";
import { axe, setup } from "testUtils";

import { mockApplications } from "./mocks";
import SubmissionsTable from "./SubmissionsTable";

describe("SubmissionsTable renders as expected", () => {
test("renders expected table headers", () => {
const { getByText } = setup(
<SubmissionsTable applications={mockApplications} />,
);
expect(getByText("Session ID")).toBeInTheDocument();
expect(getByText("Submitted At")).toBeInTheDocument();
expect(getByText("Payment Requests")).toBeInTheDocument();
expect(getByText("Payment Status")).toBeInTheDocument();
expect(getByText("BOPS Applications")).toBeInTheDocument();
expect(getByText("Uniform Applications")).toBeInTheDocument();
expect(getByText("Email Applications")).toBeInTheDocument();
});

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

const results = await axe(container);
expect(results).toHaveNoViolations();
});
});

0 comments on commit e83566f

Please sign in to comment.