Skip to content

Commit

Permalink
Improve fast categories tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Jan 15, 2024
1 parent b9583e6 commit 1a6f51e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions core/test/fast.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
addCategory,
addFeed,
addFilter,
deleteFilter,
fastCategories,
testFeed
} from '../index.js'
Expand Down Expand Up @@ -38,12 +39,12 @@ test('returns fast categories', async () => {
let feed2 = await addFeed(testFeed({ categoryId: idB, reading: 'slow' }))
await addFeed(testFeed({ categoryId: idC, reading: 'slow' }))

await addFilter({
let filter1 = await addFilter({
action: 'fast',
feedId: feed2,
query: 'includes(some)'
})
await addFilter({
let filter2 = await addFilter({
action: 'fast',
feedId: feed2,
query: 'includes(other)'
Expand All @@ -59,6 +60,16 @@ test('returns fast categories', async () => {
],
isLoading: false
})

await deleteFilter(filter1)
await deleteFilter(filter2)
deepStrictEqual(fastCategories.get(), {
categories: [
{ id: 'general', title: '' },
{ id: idA, isLoading: false, title: 'A' }
],
isLoading: false
})
})

test('returns fast category without general', async () => {
Expand Down

0 comments on commit 1a6f51e

Please sign in to comment.