diff --git a/packages/insomnia-smoke-test/core/app.test.js b/packages/insomnia-smoke-test/core/app.test.js index a18726356..6c15d5f77 100644 --- a/packages/insomnia-smoke-test/core/app.test.js +++ b/packages/insomnia-smoke-test/core/app.test.js @@ -64,7 +64,7 @@ describe('Application launch', function() { ); it('sends CSV request and shows rich response', async () => { - const url = 'http://127.0.0.1:4010/csv'; + const url = 'http://127.0.0.1:4010/file/dummy.csv'; await debug.workspaceDropdownExists(app); await debug.createNewRequest(app, 'csv'); @@ -77,9 +77,7 @@ describe('Application launch', function() { }); it('sends PDF request and shows rich response', async () => { - // Cannot mock the pdf response using Prism because it is not yet supported - // https://github.com/stoplightio/prism/issues/1248#issuecomment-646056440 - const url = 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf'; + const url = 'http://127.0.0.1:4010/file/dummy.pdf'; await debug.workspaceDropdownExists(app); await debug.createNewRequest(app, 'pdf'); diff --git a/packages/insomnia-smoke-test/fixtures/dummy.csv b/packages/insomnia-smoke-test/fixtures/dummy.csv new file mode 100644 index 000000000..bfde6bfa0 --- /dev/null +++ b/packages/insomnia-smoke-test/fixtures/dummy.csv @@ -0,0 +1,2 @@ +a,b,c +1,2,3 diff --git a/packages/insomnia-smoke-test/fixtures/dummy.pdf b/packages/insomnia-smoke-test/fixtures/dummy.pdf new file mode 100644 index 000000000..774c2ea70 Binary files /dev/null and b/packages/insomnia-smoke-test/fixtures/dummy.pdf differ diff --git a/packages/insomnia-smoke-test/server/index.js b/packages/insomnia-smoke-test/server/index.js index 8294813d8..f983da2d3 100644 --- a/packages/insomnia-smoke-test/server/index.js +++ b/packages/insomnia-smoke-test/server/index.js @@ -6,7 +6,7 @@ const app = express(); const basicAuthRouter = express.Router(); const port = 4010; -// Artificallly slow each request down +// Artificially slow each request down app.use((req, res, next) => { setTimeout(next, 500); }); @@ -15,12 +15,7 @@ app.get('/pets/:id', (req, res) => { res.status(200).send({ id: req.params.id }); }); -app.get('/csv', (_, res) => { - res - .status(200) - .header('content-type', 'text/csv') - .send(`a,b,c\n1,2,3`); -}); +app.use('/file', express.static('fixtures')); const { utf8, latin1 } = basicAuthCreds; @@ -29,11 +24,7 @@ const users = { [latin1.encoded.user]: latin1.encoded.pass, }; -basicAuthRouter.use( - basicAuth({ - users, - }), -); +basicAuthRouter.use(basicAuth({ users })); basicAuthRouter.get('/', (_, res) => { res