mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-28 23:50:08 +00:00
feat(collections): "want to revisit" status for saved places (#2567)
A fourth status after visited, for a place already seen that the user wants to go back to. It joins the one-tap cycle, the filters, the pickers, the assistant cards and the MCP status tool, and counts as visited wherever visits are counted (isVisitedCollectionStatus), so "visited everywhere" keeps it. The status pickers go two by two where four would not fit.
This commit is contained in:
@@ -108,17 +108,19 @@ describe('useSaveToCollection', () => {
|
||||
expect(result.current.unvisited).toEqual([]);
|
||||
});
|
||||
|
||||
it('FE-COMP-SAVETOCOLHOOK-004: unvisited leaves out visited and read-only lists', async () => {
|
||||
it('FE-COMP-SAVETOCOLHOOK-004: unvisited leaves out visited, to-revisit and read-only lists', async () => {
|
||||
vi.spyOn(collectionsApi, 'membership').mockResolvedValue({
|
||||
saved: true,
|
||||
lists: [
|
||||
{ collection_id: 1, name: 'Favorites', place_id: 900, status: 'visited', can_edit: true },
|
||||
{ collection_id: 2, name: 'Wishlist', place_id: 901, status: 'idea', can_edit: false },
|
||||
{ collection_id: 3, name: 'Team', place_id: 902, status: 'want', can_edit: true },
|
||||
// #2567: a place to revisit was visited already, "visited everywhere" keeps the wish.
|
||||
{ collection_id: 4, name: 'Again', place_id: 903, status: 'revisit', can_edit: true },
|
||||
],
|
||||
});
|
||||
const { result } = await loaded();
|
||||
await waitFor(() => expect(result.current.savedByCollection.size).toBe(3));
|
||||
await waitFor(() => expect(result.current.savedByCollection.size).toBe(4));
|
||||
expect(result.current.unvisited.map((l) => l.place_id)).toEqual([902]);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user