Add tests for untested PinfoldStorage write methods

Open
#29 3 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@dharamdan01 is already working on this.

Since Nov 2, 2026.

Assessment

This issue has not been assessed yet.

Description

good first issue tests

Problem
Several PinfoldStorage write methods have no tests, including the one that does imports and a migration edge case. A regression in them could silently lose or reorder saved tabs.

Where to look

  • utils/storage.js:334-347, importGroups: merge puts imported groups first; replace overwrites.
  • utils/storage.js:284-301, updateTabTitle: also renames a titled single-tab group; returns false for an unknown group or tab.
  • utils/storage.js:449-458, assignGroupToFolder: a falsy folderId becomes null.
  • utils/storage.js:460-462, clearAllData: removes groups and folders but should keep settings.
  • utils/storage.js:467-492, migrateLegacyStorage: when only tabi_stats exists, it removes that key and returns false.
  • tests/storage.test.js:9-47 (installChromeMock, store.load/store.dump), :92-98 (seedGroup).

Suggested approach

  • Add one test(...) per behavior to tests/storage.test.js, reusing seedGroup and store.dump().
  • Only add tests. If one shows a bug, report it in a new issue.

Done when

  • Each method or case listed above has at least one assertion.
  • npm test passes.


New to Pinfold? See CONTRIBUTING.md for setup and tests. Please comment here to claim this issue before you start, and wait to be assigned, so two people don't do the same work. Good first issues are meant for newcomers, so please take one at a time.

Dominant language
JavaScript
Stars
1
Forks
2
Avg merge
9h 33m
Merged PRs (30d)
29

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Tektrix/pinfold

All issues in Tektrix/pinfold

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.