feat(places): All saved shows each place once, All places shows its count

A place saved into several lists from the same trip place showed once per
list in All saved and counted that often, while All places groups the
copies as one place. All saved now shows such a place once, the first
copy read standing for it, and the rail counts All saved and All places
the way All places groups them, on the desktop and the phone.
This commit is contained in:
Maurice
2026-11-30 13:09:01 +01:00
parent b36b83a32e
commit 2204e851fa
11 changed files with 193 additions and 11 deletions
@@ -181,6 +181,43 @@ describe('section lists beside the page', () => {
expect(onSelect).toHaveBeenNthCalledWith(2, 1);
expect(onNewList).toHaveBeenCalled();
});
it('FE-MOB-PANES-018: All places above the lists, with how many places it holds once that is known', () => {
const onSelectLibrary = vi.fn();
const { rerender } = render(
<MCollListNav
lists={[]}
library
onSelectLibrary={onSelectLibrary}
libraryCount={7}
allSaved={false}
activeId={null}
onSelect={vi.fn()}
onNewList={vi.fn()}
t={echo}
/>
);
const all = screen.getByRole('button', { name: /collections.library.title/ });
expect(all).toHaveAttribute('aria-current', 'page');
expect(all).toHaveTextContent('7');
fireEvent.click(all);
expect(onSelectLibrary).toHaveBeenCalled();
rerender(
<MCollListNav
lists={[]}
onSelectLibrary={onSelectLibrary}
libraryCount={null}
allSaved={false}
activeId={null}
onSelect={vi.fn()}
onNewList={vi.fn()}
t={echo}
/>
);
expect(screen.getByRole('button', { name: /collections.library.title/ })).toHaveTextContent(
/^collections.library.title$/
);
});
});
describe('list tabs on a wide window', () => {