1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

[PM-9442] Add tests for undefined state values and proper emulation of ElectronStorageService in tests (#9910)

* fix: handle undefined value in migration 66

* fix: the if-statement was typo

* feat: duplicate error behavior in fake storage service

* feat: fix all migrations that were setting undefined values

* feat: add test for disabled fingrint in migration 66

* fix: default single user state saving undefined value to state

* revert: awaiting floating promise

gonna fix this in a separate PR

* Revert "feat: fix all migrations that were setting undefined values"

This reverts commit 034713256c.

* feat: automatically convert save to remove

* Revert "fix: default single user state saving undefined value to state"

This reverts commit 6c36da6ba5.
This commit is contained in:
Andreas Coroiu
2024-07-03 16:06:55 +02:00
committed by GitHub
parent 052b3be2eb
commit 9d060be48c
3 changed files with 83 additions and 2 deletions

View File

@@ -92,6 +92,45 @@ describe("MoveDesktopSettings", () => {
global_desktopSettings_browserIntegrationFingerprintEnabled: false,
},
},
{
it: "migrates browser integration without fingerprint enabled",
preMigration: {
global_account_accounts: {
user1: {},
otherUser: {},
},
user1: {
settings: {
minimizeOnCopyToClipboard: false,
},
},
otherUser: {
settings: {
random: "stuff",
},
},
global: {
enableBrowserIntegration: true,
},
},
postMigration: {
global_account_accounts: {
user1: {},
otherUser: {},
},
global: {},
user1: {
settings: {},
},
otherUser: {
settings: {
random: "stuff",
},
},
global_desktopSettings_browserIntegrationEnabled: true,
user_user1_desktopSettings_minimizeOnCopy: false,
},
},
{
it: "does not move non-existant values",
preMigration: {