-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: crete doc using unpaywall (#2020)
Co-authored-by: Cole Blanchard <cblanchard@Coles-MacBook-Pro.local> Co-authored-by: Yohann Paris <github@yohannparis.com>
- Loading branch information
1 parent
6a954cc
commit 4cd06b9
Showing
12 changed files
with
400 additions
and
143 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 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 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
25 changes: 25 additions & 0 deletions
25
packages/client/hmi-client/tests/unit/utils/data-util.spec.ts
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,25 @@ | ||
import { pdfNameFromUrl } from '@/utils/data-util'; | ||
import { describe, expect, it } from 'vitest'; | ||
|
||
const pdfUrl = 'https://example.com/documents/document.pdf'; | ||
const nonPdfUrl = 'https://example.com/documents/document.notapdf'; | ||
const pdfUrlWithParams = 'https://example.com/documents/document.pdf?q=12344e'; | ||
describe('data util tests', () => { | ||
it('gets pdf url name', () => { | ||
const pdfName = pdfNameFromUrl(pdfUrl); | ||
|
||
expect(pdfName).toBe('document.pdf'); | ||
}); | ||
|
||
it('gets pdf url name with params', () => { | ||
const pdfName = pdfNameFromUrl(pdfUrlWithParams); | ||
|
||
expect(pdfName).toBe('document.pdf'); | ||
}); | ||
|
||
it('returns null on bad url', () => { | ||
const pdfName = pdfNameFromUrl(nonPdfUrl); | ||
|
||
expect(pdfName).toBeNull(); | ||
}); | ||
}); |
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
Oops, something went wrong.