mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 21:02:28 +00:00
Remove legacy auth cache migration docs and add regression test
Removes obsolete "Migration notes" from `docs/nostr-auth.md` and adds a regression test to `tests/state/cache-saved-profiles.test.mjs` to confirm that the legacy `userPubKey` localStorage key is ignored during startup. Also polyfills localStorage for the test suite.
This commit is contained in:
1 parent
ad961cd401
commit
f5eba4121f
2 files changed
+14
-12
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import "../test-helpers/setup-localstorage.mjs";
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
|
||||
@@ -149,3 +150,14 @@ test("loadSavedProfilesFromStorage trims stored authType values", () => {
|
||||
assert.equal(stored.entries[0].authType, "extension-provider");
|
||||
assert.equal(stored.entries[0].providerId, "extension-provider");
|
||||
});
|
||||
|
||||
test("loadSavedProfilesFromStorage ignores legacy userPubKey", () => {
|
||||
resetSavedProfilesState();
|
||||
|
||||
localStorage.setItem("userPubKey", SAMPLE_PUBKEY);
|
||||
// Ensure the modern key is missing/empty
|
||||
localStorage.removeItem(STORAGE_KEY);
|
||||
|
||||
const { profiles } = loadSavedProfilesFromStorage();
|
||||
assert.equal(profiles.length, 0, "Expected no profiles to be loaded from legacy key");
|
||||
});
|
||||
Reference in new issue
Block a user