Skip to content
Snippets Groups Projects
Commit bfad5f2a authored by Jennifer Spencer's avatar Jennifer Spencer
Browse files

test(FileUpload): add file upload to e2e happy path

parent 41274ba3
No related branches found
No related tags found
1 merge request!33feat: hook up file upload widget to backend
Pipeline #6478 passed with stages
in 2 minutes and 39 seconds
...@@ -21,6 +21,7 @@ const FileUploads = ({ onDrop, conversion }) => ( ...@@ -21,6 +21,7 @@ const FileUploads = ({ onDrop, conversion }) => (
<Box mb={3} width={1}> <Box mb={3} width={1}>
<FileUpload <FileUpload
conversion={conversion} conversion={conversion}
data-test-id="upload"
instruction="Drag and drop or click to upload your cover letter" instruction="Drag and drop or click to upload your cover letter"
onDrop={onDrop} onDrop={onDrop}
/> />
......
...@@ -26,10 +26,11 @@ const CentredFlex = styled(Flex)` ...@@ -26,10 +26,11 @@ const CentredFlex = styled(Flex)`
align-items: center; align-items: center;
` `
const FileUpload = ({ onDrop, conversion, instruction }) => ( const FileUpload = ({ onDrop, conversion, instruction, ...props }) => (
<StyledDropzone <StyledDropzone
accept="application/vnd.openxmlformats-officedocument.wordprocessingml.document" accept="application/vnd.openxmlformats-officedocument.wordprocessingml.document"
onDrop={onDrop} onDrop={onDrop}
{...props}
> >
<CentredFlex> <CentredFlex>
<Box width={1}> <Box width={1}>
......
File added
File added
...@@ -42,10 +42,15 @@ test('Happy path', async t => { ...@@ -42,10 +42,15 @@ test('Happy path', async t => {
.typeText('[name=lastName]', 'Author') .typeText('[name=lastName]', 'Author')
.typeText('[name=email]', 'anne.author@life.ac.uk') .typeText('[name=email]', 'anne.author@life.ac.uk')
.typeText('[name=institute]', 'University of Life') .typeText('[name=institute]', 'University of Life')
.click('[data-test-id=next') .click('[data-test-id=next]')
// file uploads // file uploads
await t.click('[data-test-id=next]') await t
.setFilesToUpload(
'[data-test-id=upload]>input',
'./fixtures/dummy-manuscript.docx',
)
.click('[data-test-id=next]')
// metadata // metadata
await t.click('[data-test-id=next]') await t.click('[data-test-id=next]')
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment