test(places): cover the place sheet sections, tags, trip lists and the visited filter

This commit is contained in:
Maurice
2026-11-29 21:16:39 +01:00
parent d008331e5f
commit c944ef6de5
60 changed files with 4182 additions and 44 deletions
+11
View File
@@ -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)
})
})