mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
[PM-10791] Set favorite on import from ProtonPass (#10480)
* Update import test data with new fields Add new fields to the types file * Set favorites when importing from ProtonPass --------- Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
a3d2bb60d1
commit
3ef1080754
@@ -116,4 +116,14 @@ describe("Protonpass Json Importer", () => {
|
||||
|
||||
expect(ciphers.length).toBe(4);
|
||||
});
|
||||
|
||||
it("should set favorites", async () => {
|
||||
const testDataJson = JSON.stringify(testData);
|
||||
const result = await importer.parse(testDataJson);
|
||||
|
||||
const ciphers = result.ciphers;
|
||||
expect(ciphers[0].favorite).toBe(true);
|
||||
expect(ciphers[1].favorite).toBe(false);
|
||||
expect(ciphers[2].favorite).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ProtonPassJsonFile } from "../../../src/importers/protonpass/types/protonpass-json-type";
|
||||
|
||||
export const testData: ProtonPassJsonFile = {
|
||||
version: "1.3.1",
|
||||
version: "1.21.2",
|
||||
userId: "REDACTED_USER_ID",
|
||||
encrypted: false,
|
||||
vaults: {
|
||||
@@ -54,6 +54,7 @@ export const testData: ProtonPassJsonFile = {
|
||||
urls: ["https://example.com/", "https://example2.com/"],
|
||||
totpUri:
|
||||
"otpauth://totp/Test%20Login%20-%20Personal%20Vault:Username?issuer=Test%20Login%20-%20Personal%20Vault&secret=TOTPCODE&algorithm=SHA1&digits=6&period=30",
|
||||
passkeys: [],
|
||||
itemUsername: "Username",
|
||||
},
|
||||
},
|
||||
@@ -62,6 +63,7 @@ export const testData: ProtonPassJsonFile = {
|
||||
contentFormatVersion: 1,
|
||||
createTime: 1689182868,
|
||||
modifyTime: 1689182868,
|
||||
pinned: true,
|
||||
},
|
||||
{
|
||||
itemId:
|
||||
@@ -83,6 +85,7 @@ export const testData: ProtonPassJsonFile = {
|
||||
contentFormatVersion: 1,
|
||||
createTime: 1689182908,
|
||||
modifyTime: 1689182908,
|
||||
pinned: false,
|
||||
},
|
||||
{
|
||||
itemId:
|
||||
@@ -111,6 +114,7 @@ export const testData: ProtonPassJsonFile = {
|
||||
contentFormatVersion: 1,
|
||||
createTime: 1691001643,
|
||||
modifyTime: 1691001643,
|
||||
pinned: true,
|
||||
},
|
||||
{
|
||||
itemId:
|
||||
@@ -132,6 +136,7 @@ export const testData: ProtonPassJsonFile = {
|
||||
contentFormatVersion: 1,
|
||||
createTime: 1689182908,
|
||||
modifyTime: 1689182908,
|
||||
pinned: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -161,6 +166,7 @@ export const testData: ProtonPassJsonFile = {
|
||||
password: "other vault password",
|
||||
urls: [],
|
||||
totpUri: "JBSWY3DPEHPK3PXP",
|
||||
passkeys: [],
|
||||
itemUsername: "",
|
||||
},
|
||||
},
|
||||
@@ -169,6 +175,7 @@ export const testData: ProtonPassJsonFile = {
|
||||
contentFormatVersion: 1,
|
||||
createTime: 1689182949,
|
||||
modifyTime: 1689182949,
|
||||
pinned: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user