Skip to content

Commit

Permalink
PRMP-1292 - ensure files table includes a file size information such …
Browse files Browse the repository at this point in the history
…as file size measure units
  • Loading branch information
abid-nhs committed Dec 16, 2024
1 parent a53a3e6 commit 4cee8d7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ describe('LloydGeorgeSelectSearchResults', () => {
expect(screen.getByTestId('toggle-selection-btn')).toBeInTheDocument();
});

it('renders the correct table headers', () => {
renderComponent({ selectedDocuments: mockSelectedDocuments });

const headers = screen.getAllByRole('columnheader');
const expectedHeaders = ['Selected', 'Filename', 'Upload date', 'File Size'];

expectedHeaders.forEach((headerText, index) => {
expect(headers[index]).toHaveTextContent(headerText);
});

const filesTable = screen.getByTestId('available-files-table-title');
expect(filesTable).toHaveTextContent(/bytes|KB|MB|GB/);
});

it('shows error box when download selected files button is clicked but no files selected', async () => {
renderComponent({ selectedDocuments: [] });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const AvailableFilesTable = ({
id={'available-files-row-' + index + '-file-size'}
data-testid="file-size"
>
{result.fileSize}
{formatFileSize(result.fileSize)}
</Table.Cell>
</Table.Row>
))}
Expand Down

0 comments on commit 4cee8d7

Please sign in to comment.