mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
fix tests
This commit is contained in:
parent
c1ba9b8017
commit
03f89d890e
4 changed files with 5 additions and 5 deletions
|
|
@ -104,7 +104,7 @@ export const createPageSaveRequest = async ({
|
|||
// create processing item
|
||||
const libraryItem = await createOrUpdateLibraryItem(
|
||||
{
|
||||
id: articleSavingRequestId,
|
||||
id: articleSavingRequestId || undefined,
|
||||
user: { id: userId },
|
||||
readableContent: SAVING_CONTENT,
|
||||
itemType: PageType.Unknown,
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ export const savePage = async (
|
|||
await createPageSaveRequest({
|
||||
user,
|
||||
url: input.url,
|
||||
articleSavingRequestId: clientRequestId,
|
||||
articleSavingRequestId: clientRequestId || undefined,
|
||||
state: input.state || undefined,
|
||||
labels: input.labels || undefined,
|
||||
folder: input.folder || undefined,
|
||||
|
|
|
|||
|
|
@ -634,7 +634,7 @@ describe('Article API', () => {
|
|||
|
||||
const savedItem = await findLibraryItemByUrl(url, user.id)
|
||||
expect(savedItem?.archivedAt).to.not.be.null
|
||||
expect(savedItem?.labels?.map((l) => l.name)).to.eql(labels)
|
||||
expect(savedItem?.labels?.map((l) => l.name)).to.include.members(labels)
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { isOldItem, RssFeedItem } from '../src'
|
|||
describe('isOldItem', () => {
|
||||
it('returns true if item is older than 1 day', () => {
|
||||
const item = {
|
||||
pubDate: '2020-01-01',
|
||||
isoDate: '2020-01-01',
|
||||
} as RssFeedItem
|
||||
const mostRecentItemTimestamp = Date.now()
|
||||
|
||||
|
|
@ -15,7 +15,7 @@ describe('isOldItem', () => {
|
|||
it('returns true if item was published at the last fetched time', () => {
|
||||
const mostRecentItemTimestamp = Date.now()
|
||||
const item = {
|
||||
pubDate: new Date(mostRecentItemTimestamp).toISOString(),
|
||||
isoDate: new Date(mostRecentItemTimestamp).toISOString(),
|
||||
} as RssFeedItem
|
||||
|
||||
expect(isOldItem(item, mostRecentItemTimestamp)).to.be.true
|
||||
|
|
|
|||
Loading…
Reference in a new issue