mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Add an uploadFileTest to verify GCS URLs are used for file:// objects
This commit is contained in:
parent
98bc1470b5
commit
70d655f591
2 changed files with 9 additions and 2 deletions
|
|
@ -22,7 +22,7 @@ public struct PDFItem {
|
|||
objectID: item.objectID,
|
||||
itemID: item.unwrappedID,
|
||||
pdfURL: URL(string: item.unwrappedPageURLString),
|
||||
localPdfURL: item.localPdfURL.flatMap { URL(string: $0) },
|
||||
localPdfURL: nil, // item.localPdfURL.flatMap { URL(string: $0) },
|
||||
title: item.unwrappedID,
|
||||
slug: item.unwrappedSlug,
|
||||
readingProgress: item.readingProgress,
|
||||
|
|
|
|||
|
|
@ -89,11 +89,18 @@ describe('uploadFileRequest API', () => {
|
|||
})
|
||||
|
||||
it('should create an article if create article is true', async () => {
|
||||
const res = uploadFileRequest(authToken, 'https://www.google.com', clientRequestId, true).expect(200)
|
||||
const res = await uploadFileRequest(authToken, 'https://www.google.com', clientRequestId, true)
|
||||
expect(res.body.data.uploadFileRequest.createdPageId).to.eql(clientRequestId)
|
||||
const page = await getPageById(clientRequestId)
|
||||
expect(page).to.be
|
||||
})
|
||||
|
||||
it('should not save a file:// URL', async () => {
|
||||
const res = await uploadFileRequest(authToken, 'file://foo.bar', clientRequestId, true)
|
||||
expect(res.body.data.uploadFileRequest.createdPageId).to.eql(clientRequestId)
|
||||
const page = await getPageById(clientRequestId)
|
||||
expect(page.url).to.startWith("https://")
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue