diff --git a/changes/30393-pagination b/changes/30393-pagination new file mode 100644 index 0000000000..83d574075b --- /dev/null +++ b/changes/30393-pagination @@ -0,0 +1 @@ +* Switched page size for software versions shown on the software view page from 5 to 10. diff --git a/frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/SoftwareSummaryCard/TitleVersionsTable/TitleVersionsTable.tests.tsx b/frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/SoftwareSummaryCard/TitleVersionsTable/TitleVersionsTable.tests.tsx index 6f7c18c193..6c7084a879 100644 --- a/frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/SoftwareSummaryCard/TitleVersionsTable/TitleVersionsTable.tests.tsx +++ b/frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/SoftwareSummaryCard/TitleVersionsTable/TitleVersionsTable.tests.tsx @@ -11,6 +11,11 @@ describe("TitleVersionsTable", () => { const versions = [ { id: 10, version: "1.2.3", vulnerabilities: [] }, { id: 11, version: "1.2.4", vulnerabilities: [] }, + { id: 12, version: "1.2.5", vulnerabilities: [] }, + { id: 13, version: "1.2.6", vulnerabilities: [] }, + { id: 14, version: "1.2.7", vulnerabilities: [] }, + { id: 15, version: "1.2.8", vulnerabilities: [] }, + { id: 16, version: "1.2.9", vulnerabilities: [] }, ]; render( @@ -26,12 +31,13 @@ describe("TitleVersionsTable", () => { // There should be one cell with a link for the version const cells = screen.getAllByRole("cell"); - expect(cells).toHaveLength(8); + // Version, Vulnerabilities, Hosts, View all hosts for each row + expect(cells).toHaveLength(4 * 7); expect(screen.getByText(/1.2.3/i)).toBeInTheDocument(); - expect(screen.getByText(/1.2.4/i)).toBeInTheDocument(); + expect(screen.getByText(/1.2.9/i)).toBeInTheDocument(); // make sure // Version count should be shown - expect(screen.getByText(/2 versions/i)).toBeInTheDocument(); + expect(screen.getByText(/7 versions/i)).toBeInTheDocument(); // Last updated info should be shown expect(screen.getByText(/updated/i)).toBeInTheDocument(); diff --git a/frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/SoftwareSummaryCard/TitleVersionsTable/TitleVersionsTable.tsx b/frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/SoftwareSummaryCard/TitleVersionsTable/TitleVersionsTable.tsx index 645b1e7f14..dda8f59351 100644 --- a/frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/SoftwareSummaryCard/TitleVersionsTable/TitleVersionsTable.tsx +++ b/frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/SoftwareSummaryCard/TitleVersionsTable/TitleVersionsTable.tsx @@ -20,7 +20,7 @@ import generateSoftwareTitleVersionsTableConfig from "./TitleVersionsTableConfig const DEFAULT_SORT_HEADER = "hosts_count"; const DEFAULT_SORT_DIRECTION = "desc"; -const DEFAULT_PAGE_SIZE = 5; +const DEFAULT_PAGE_SIZE = 10; const baseClass = "software-title-versions-table";