Skip to content

Commit

Permalink
[PRMP-1040] Make pdf viewer toolbar visible (#453)
Browse files Browse the repository at this point in the history
Make toolbar visible
  • Loading branch information
steph-torres-nhs authored Oct 29, 2024
1 parent 7831b05 commit 273955c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/src/components/generic/pdfViewer/PdfViewer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ describe('PdfViewer', () => {
it('renders an embed element', () => {
render(<PdfViewer fileUrl="https://test" />);

expect(screen.getByTitle('Embedded PDF')).toBeInTheDocument();
const embedElement = screen.getByTitle('Embedded PDF') as HTMLEmbedElement;
expect(embedElement).toBeInTheDocument();
expect(embedElement.src).toMatch(/#toolbar$/);
});
});
2 changes: 1 addition & 1 deletion app/src/components/generic/pdfViewer/PdfViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type Props = { fileUrl: String };
const PdfViewer = ({ fileUrl }: Props) => {
useEffect(() => {
const pdfObject = require('pdfobject');
pdfObject.embed(fileUrl + '#toolbar=0', '#pdf-viewer');
pdfObject.embed(fileUrl + '#toolbar', '#pdf-viewer');
}, [fileUrl]);

if (!fileUrl) return null;
Expand Down

0 comments on commit 273955c

Please sign in to comment.