Skip to content

Commit

Permalink
woke up in a cold sweat realizing that the indexing for the text was …
Browse files Browse the repository at this point in the history
…wrong so I fixed it
  • Loading branch information
joshri committed Jan 30, 2022
1 parent 5229ca7 commit 3ff82f2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions ui/components/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ function UnstyledDataTable({
</FormControl>
<Spacer padding="base" />
<Text>
{pagination.start === 0 ? 1 : pagination.start} -{" "}
{pagination.start + r.length} out of {rows.length}
{pagination.start + 1} - {pagination.start + r.length} out of{" "}
{rows.length}
</Text>
<Spacer padding="base" />
<Flex>
Expand Down
8 changes: 4 additions & 4 deletions ui/components/__tests__/DataTable.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ describe("DataTable", () => {
const skipForward = screen.getByLabelText("skip to last page");
const displayText = screen.getByText(/1 - 1 out of 3/);
fireEvent.click(forward);
expect(displayText.innerHTML).toContain("2");
expect(displayText.innerHTML).toContain("2 - 2 out of 3");
fireEvent.click(back);
expect(displayText.innerHTML).toContain("1");
expect(displayText.innerHTML).toContain("1 - 1 out of 3");
fireEvent.click(skipForward);
expect(displayText.innerHTML).toContain("3 out of 3");
expect(displayText.innerHTML).toContain("3 - 3 out of 3");
fireEvent.click(skipBack);
expect(displayText.innerHTML).toContain("1 - 1");
expect(displayText.innerHTML).toContain("1 - 1 out of 3");
});
it("disables buttons based on page location", () => {
render(
Expand Down
6 changes: 3 additions & 3 deletions ui/components/__tests__/__snapshots__/DataTable.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -515,10 +515,10 @@ exports[`DataTable snapshots renders 1`] = `
size="normal"
>
1
-
-
3
out of
out of
3
</span>
<div
Expand Down

0 comments on commit 3ff82f2

Please sign in to comment.