mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-30 16:33:16 +00:00
test(places): cover the place sheet sections, tags, trip lists and the visited filter
This commit is contained in:
@@ -107,4 +107,15 @@ describe('placesFilter', () => {
|
||||
expect(withoutTagFilters(filters, [9])).toBe(filters)
|
||||
expect(withoutTagFilters(filters, [])).toBe(filters)
|
||||
})
|
||||
it('FE-UTIL-PLFILTER-011: "visited" keeps only the places the reader was at, and nothing without the set', () => {
|
||||
const been = buildPlace({ id: 1 })
|
||||
const notYet = buildPlace({ id: 2 })
|
||||
const visitedIds = new Set([1])
|
||||
expect(matchesPoolFilter(been, 'visited', { plannedIds: null, visitedIds })).toBe(true)
|
||||
expect(matchesPoolFilter(notYet, 'visited', { plannedIds: null, visitedIds })).toBe(false)
|
||||
expect(matchesPoolFilter(been, 'visited', { plannedIds: null })).toBe(false)
|
||||
expect(matchesPoolFilter(been, 'visited', { plannedIds: null, visitedIds: null })).toBe(false)
|
||||
// The other pools do not read the visited set.
|
||||
expect(matchesPoolFilter(notYet, 'all', { plannedIds: null, visitedIds })).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user