Repository navigation
test(address-book): expand unit tests for all CRUD functions - #626
Merged
Austinaminu2 merged 1 commit intoAug 25, 2026
Merged
Austinaminu2 merged 1 commit into
Austinaminu2 merged 1 commit into
Conversation
…ar#498) - Replace window.localStorage.clear() with a vi.stubGlobal spy mock so tests have full call-count visibility and store isolation - Add getAddressBookEntries: non-array JSON and null-storage edge cases - Add addAddressBookEntry: prepend order, unique-id, persist-to-storage - Add updateAddressBookEntry: address/lastUsed field patches, persist - Add deleteAddressBookEntry: empty-list result, persist check - Add touchAddressBookEntry: empty-string address, label trim, empty-string label keeps existing, persist, no side-effects on peers Closes FlowwStar#498
brightfootlimited-collab
had a problem deploying
to
staging
August 25, 2026 21:26 — with
GitHub Actions
Failure
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary Expands the unit tests for \lib/address-book.ts\ to cover all five exported functions with additional edge cases and spy-based localStorage isolation. Closes #498 ## What changed - Replaced \window.localStorage.clear()\ with a \�i.stubGlobal\ spy mock for full call-count visibility and isolated store state per test - *\getAddressBookEntries* — added: non-array JSON returns [], null storage returns []\ - *\�ddAddressBookEntry* — added: prepend order verified in storage, unique IDs for rapid calls, persist-to-localStorage assertion - *\updateAddressBookEntry* — added: address field patch, \lastUsed\ field patch, persist-to-localStorage assertion - *\deleteAddressBookEntry* — added: empty-list result after sole entry deleted, persist-to-localStorage assertion - *\ ouchAddressBookEntry* — added: empty-string address returns null, label trimming, empty-string label keeps existing label, persist assertion, no side-effects on sibling entries ## Testing All new cases are pure unit tests using Vitest + jsdom — no network, no additional dependencies.