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
adf13131db
commit
59bbc5562b
3 changed files with 4 additions and 15 deletions
|
|
@ -229,9 +229,7 @@ const buildWhereClause = (
|
|||
}
|
||||
|
||||
if (!args.includeDeleted && args.inFilter !== InFilter.TRASH) {
|
||||
queryBuilder.andWhere('library_item.folder <> :folder', {
|
||||
folder: InFilter.TRASH,
|
||||
})
|
||||
queryBuilder.andWhere("library_item.folder <> 'trash'")
|
||||
}
|
||||
|
||||
if (args.noFilters) {
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ export const libraryItemToArticle = (item: LibraryItem): Article => ({
|
|||
state: item.state as unknown as ArticleSavingRequestStatus,
|
||||
content: item.readableContent,
|
||||
hash: item.textContentHash || '',
|
||||
isArchived: item.folder != InFilter.ARCHIVE,
|
||||
isArchived: item.folder === InFilter.ARCHIVE,
|
||||
recommendations: item.recommendations?.map(
|
||||
recommandationDataToRecommendation
|
||||
),
|
||||
|
|
@ -259,7 +259,7 @@ export const libraryItemToSearchItem = (item: LibraryItem): SearchItem => ({
|
|||
url: item.originalUrl,
|
||||
state: item.state as unknown as ArticleSavingRequestStatus,
|
||||
content: item.readableContent,
|
||||
isArchived: item.folder != InFilter.ARCHIVE,
|
||||
isArchived: item.folder === InFilter.ARCHIVE,
|
||||
pageType: item.itemType as unknown as PageType,
|
||||
readingProgressPercent: item.readingProgressBottomPercent,
|
||||
contentReader: item.contentReader as unknown as ContentReader,
|
||||
|
|
|
|||
|
|
@ -691,7 +691,7 @@ describe('Article API', () => {
|
|||
200
|
||||
)
|
||||
const item = await findLibraryItemById(itemId, user.id)
|
||||
expect(item?.state).to.eql(LibraryItemState.Deleted)
|
||||
expect(item?.folder).to.eql('trash')
|
||||
})
|
||||
})
|
||||
|
||||
|
|
@ -1167,14 +1167,6 @@ describe('Article API', () => {
|
|||
slug: 'test slug 1',
|
||||
originalUrl: `${url}/test1`,
|
||||
},
|
||||
{
|
||||
user,
|
||||
title: 'test title 2',
|
||||
readableContent: '<p>test 2</p>',
|
||||
slug: 'test slug 2',
|
||||
originalUrl: `${url}/test2`,
|
||||
subscription: 'test subscription',
|
||||
},
|
||||
{
|
||||
user,
|
||||
title: 'test title 3',
|
||||
|
|
@ -1188,7 +1180,6 @@ describe('Article API', () => {
|
|||
)
|
||||
await saveLabelsInLibraryItem([label], items[0].id, user.id)
|
||||
await saveLabelsInLibraryItem([label], items[1].id, user.id)
|
||||
await saveLabelsInLibraryItem([label], items[2].id, user.id)
|
||||
})
|
||||
|
||||
after(async () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue