Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
feat(Elife): Expose the figures PDF URI
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcmoulton committed Apr 2, 2020
1 parent 4d0f766 commit 8a1b1db
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/themes/elife/eLifeDataProvider.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
interface Response {
ok: boolean
articleData: { pdf: string }
articleData: { pdf: string; figuresPdf: string }
}

export default {
Expand Down
15 changes: 14 additions & 1 deletion src/themes/elife/test/eifeDataProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,20 @@ describe('eLife Data Provider ', () => {
})
})

test.todo('it exposes the URI of the figures PDF')
it('it exposes the URI of the figures PDF', async () => {
const fetchMock = (): Promise<Response> =>
Promise.resolve({
ok: true,
json: () =>
Promise.resolve({
figuresPdf: 'path-to-the-figures.pdf'
})
})
await expect(dataProvider.query('someId', fetchMock)).resolves.toEqual({
articleData: { figuresPdf: 'path-to-the-figures.pdf' },
ok: true
})
})
})

describe('being given an invalid article id', () => {
Expand Down

0 comments on commit 8a1b1db

Please sign in to comment.