-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from formio/add-e2e-tests
FIO-8750: Add E2E tests
- Loading branch information
Showing
12 changed files
with
808 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM formio/pdf-libs:tmp | ||
|
||
WORKDIR /usr/src/pdf-libs | ||
# Remove test folder | ||
RUN rm -rf test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const path = require('path'); | ||
const assert = require('assert'); | ||
const superagent = require('superagent'); | ||
const runServer = require('./runServer'); | ||
|
||
const PDF_FIXTURE = path.resolve(__dirname, './fixtures/fw4.pdf'); | ||
|
||
describe('Test convertToHtml', () => { | ||
let server; | ||
|
||
before(async () => { | ||
server = await runServer(3000); | ||
}); | ||
|
||
it('should return html', async () => { | ||
const response = await superagent | ||
.post(`http://localhost:3000/pdf/convertToHtml`) | ||
.set('Content-Type', 'multipart/form-data') | ||
.attach('pdf', PDF_FIXTURE); | ||
|
||
const html = response.text; | ||
assert.ok(html.includes('<!DOCTYPE html>')); | ||
assert.ok(html.includes('Base CSS for pdf2htmlEX')); | ||
}); | ||
|
||
after(() => { | ||
server.kill(); | ||
}); | ||
}); |
Oops, something went wrong.