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

Fix totp import on Dashlane csv importer (#11747)

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
This commit is contained in:
Daniel James Smith
2024-11-13 15:11:53 +01:00
committed by GitHub
parent 88cbee9b0a
commit 913f109ffa
4 changed files with 14 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ import { CipherType } from "@bitwarden/common/vault/enums";
import { DashlaneCsvImporter } from "../src/importers";
import { credentialsData_otpUrl } from "./test-data/dashlane-csv/credentials-otpurl.csv";
import { credentialsData } from "./test-data/dashlane-csv/credentials.csv";
import { identityData } from "./test-data/dashlane-csv/id.csv";
import { multiplePersonalInfoData } from "./test-data/dashlane-csv/multiple-personal-info.csv";
@@ -30,6 +31,14 @@ describe("Dashlane CSV Importer", () => {
expect(cipher.notes).toEqual("some note for example.com");
});
it("should parse login with totp when given otpUrl instead of otpSecret", async () => {
const result = await importer.parse(credentialsData_otpUrl);
expect(result != null).toBe(true);
const cipher = result.ciphers.shift();
expect(cipher.login.totp).toEqual("anotherTOTPSeed");
});
it("should parse an item and create a folder", async () => {
const result = await importer.parse(credentialsData);

View File

@@ -0,0 +1,2 @@
export const credentialsData_otpUrl = `username,username2,username3,title,password,note,url,category,otpUrl
jdoe,,,example.com,somePassword,some note for example.com,https://www.example.com,Entertainment,anotherTOTPSeed`;