test(sweep): seeded contacts-cards/list/table surfaces for the view toggle
Add three sweep surfaces (contacts-cards / -list / -table) that force each Contacts address-list view mode and seed a few demo contacts (Z + T types, some global) so the modes render with data instead of the empty state. Teardown restores the real book and resets the mode. To avoid touching the user's persisted address book (the Windows sweep can run on the real HOME, and addEntry/removeEntry call save()), add AddressBook::sweepSetEntries — a no-save in-memory setter used only here: the surface snapshots the real entries, swaps in the demo set, and restores the snapshot on teardown, so nothing is written to disk even if the sweep is interrupted. Build + hygiene clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -109,6 +109,12 @@ public:
|
||||
*/
|
||||
size_t size() const { return entries_.size(); }
|
||||
|
||||
/**
|
||||
* @brief UI-sweep ONLY: replace the in-memory entries WITHOUT persisting to disk, so the sweep can
|
||||
* seed demo contacts and restore the real book without a disk write. Do not use outside the sweep.
|
||||
*/
|
||||
void sweepSetEntries(std::vector<AddressBookEntry> e) { entries_ = std::move(e); }
|
||||
|
||||
/**
|
||||
* @brief Check if empty
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user