Skip to content

Commit

Permalink
fix: uncomment pagination as API is ready
Browse files Browse the repository at this point in the history
  • Loading branch information
OlhaD committed Aug 15, 2023
1 parent 281178f commit 27db765
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 26 deletions.
3 changes: 1 addition & 2 deletions src/pages/MyTransfers/MyTransfers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ describe('My Transfers page', function () {
</TestWrapper>
);

// TODO: uncomment when the API is ready: github.com/Greenstand/treetracker-wallet-api/issues/385
// expect(await screen.findByTestId('table-pagination')).toBeInTheDocument();
expect(await screen.findByTestId('table-pagination')).toBeInTheDocument();
expect(await screen.findByTestId('transfers-table')).toBeInTheDocument();
expect(await screen.findByTestId('date-range-filter')).toBeInTheDocument();
expect(
Expand Down
15 changes: 4 additions & 11 deletions src/pages/MyTransfers/TransfersTable.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
{
/* TODO: Uncomment this to enable pagination when the API is ready:
https://github.com/Greenstand/treetracker-wallet-api/issues/385 */
}
/* eslint-disable no-unused-vars */
import {
Grid,
Paper,
Expand All @@ -11,7 +6,7 @@ import {
TableCell,
TableContainer,
TableHead,
// TablePagination,
TablePagination,
TableRow,
Typography,
} from '@mui/material';
Expand Down Expand Up @@ -229,18 +224,16 @@ const TransfersTable = ({ tableTitle, tableRows, totalRowCount }) => {
</Table>
</TableContainer>

{/* TODO: Uncomment this to enable pagination when the API is ready:
https://github.com/Greenstand/treetracker-wallet-api/issues/385 */}
{/* <TablePagination
<TablePagination
rowsPerPageOptions={[10, 50]}
component={'div'}
count={totalRowCount}
rowsPerPage={rowsPerPage}
onRowsPerPageChange={handleRowsPerPageChange}
page={page}
onPageChange={(e, newPage) => handlePageChange(e, newPage)}
data-testid='table-pagination'
/> */}
data-testid="table-pagination"
/>
</Grid>
);
};
Expand Down
24 changes: 11 additions & 13 deletions src/pages/MyTransfers/TransfersTable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ describe('Transfers Table', () => {
</TestWrapper>
);

// TODO: uncomment when the API is ready: github.com/Greenstand/treetracker-wallet-api/issues/385
// expect(await screen.findByTestId('table-pagination')).toBeInTheDocument();
expect(await screen.findByTestId('table-pagination')).toBeInTheDocument();
https: expect(
await screen.findByTestId('transfers-table')
).toBeInTheDocument();
Expand All @@ -78,16 +77,15 @@ describe('Transfers Table', () => {
expect(screen.getAllByRole('cell')).toHaveLength(8 * 3);
});

// TODO: uncomment when the API is ready: github.com/Greenstand/treetracker-wallet-api/issues/385
// expect(await screen.findByTestId('table-pagination')).toBeInTheDocument();
// expect(
// screen.getByRole('button', { name: 'Rows per page: 10' })
// ).toBeInTheDocument();
// expect(
// screen.getByRole('button', { name: 'Go to previous page' })
// ).toBeInTheDocument();
// expect(
// screen.getByRole('button', { name: 'Go to next page' })
// ).toBeInTheDocument();
expect(await screen.findByTestId('table-pagination')).toBeInTheDocument();
expect(
screen.getByRole('button', { name: 'Rows per page: 10' })
).toBeInTheDocument();
expect(
screen.getByRole('button', { name: 'Go to previous page' })
).toBeInTheDocument();
expect(
screen.getByRole('button', { name: 'Go to next page' })
).toBeInTheDocument();
});
});

0 comments on commit 27db765

Please sign in to comment.