diff --git a/app/src/components/blocks/_lloydGeorge/lloydGeorgeSelectSearchResults/LloydGeorgeSelectSearchResults.test.tsx b/app/src/components/blocks/_lloydGeorge/lloydGeorgeSelectSearchResults/LloydGeorgeSelectSearchResults.test.tsx index 877a70902..664812c83 100644 --- a/app/src/components/blocks/_lloydGeorge/lloydGeorgeSelectSearchResults/LloydGeorgeSelectSearchResults.test.tsx +++ b/app/src/components/blocks/_lloydGeorge/lloydGeorgeSelectSearchResults/LloydGeorgeSelectSearchResults.test.tsx @@ -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: [] }); diff --git a/app/src/components/blocks/_lloydGeorge/lloydGeorgeSelectSearchResults/LloydGeorgeSelectSearchResults.tsx b/app/src/components/blocks/_lloydGeorge/lloydGeorgeSelectSearchResults/LloydGeorgeSelectSearchResults.tsx index cc9ce9653..7ee2c2ae7 100644 --- a/app/src/components/blocks/_lloydGeorge/lloydGeorgeSelectSearchResults/LloydGeorgeSelectSearchResults.tsx +++ b/app/src/components/blocks/_lloydGeorge/lloydGeorgeSelectSearchResults/LloydGeorgeSelectSearchResults.tsx @@ -153,7 +153,7 @@ const AvailableFilesTable = ({ id={'available-files-row-' + index + '-file-size'} data-testid="file-size" > - {result.fileSize} + {formatFileSize(result.fileSize)} ))}