mirror of
https://github.com/bitwarden/browser
synced 2026-01-31 16:53:27 +00:00
add spec. fix id export
This commit is contained in:
@@ -14,7 +14,6 @@ export class IdentityExport {
|
||||
req.lastName = "Doe";
|
||||
req.address1 = "123 Any St";
|
||||
req.address2 = "Apt #123";
|
||||
req.address3 = "";
|
||||
req.city = "New York";
|
||||
req.state = "NY";
|
||||
req.postalCode = "10001";
|
||||
@@ -103,7 +102,6 @@ export class IdentityExport {
|
||||
this.lastName = safeGetString(o.lastName);
|
||||
this.address1 = safeGetString(o.address1);
|
||||
this.address2 = safeGetString(o.address2);
|
||||
this.address3 = safeGetString(o.address3);
|
||||
this.city = safeGetString(o.city);
|
||||
this.state = safeGetString(o.state);
|
||||
this.postalCode = safeGetString(o.postalCode);
|
||||
|
||||
29
libs/common/src/models/export/secure-note.export.spec.ts
Normal file
29
libs/common/src/models/export/secure-note.export.spec.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { SecureNote } from "@bitwarden/common/vault/models/domain/secure-note";
|
||||
import { SecureNoteView } from "@bitwarden/common/vault/models/view/secure-note.view";
|
||||
|
||||
import { SecureNoteExport } from "./secure-note.export";
|
||||
|
||||
describe("SecureNoteExport", () => {
|
||||
describe("toView", () => {
|
||||
it("should map fields correctly", () => {
|
||||
const validSecureNote = {
|
||||
type: "SecureNote",
|
||||
} as any;
|
||||
const result = SecureNoteExport.toView(new SecureNoteExport(validSecureNote));
|
||||
expect(result).toBeInstanceOf(SecureNoteView);
|
||||
expect(result.type).toBe(validSecureNote.type);
|
||||
});
|
||||
});
|
||||
|
||||
describe("toDomain", () => {
|
||||
it("should map fields correctly", () => {
|
||||
const validSecureNote = {
|
||||
type: "SecureNote",
|
||||
} as any;
|
||||
const result = SecureNoteExport.toDomain(new SecureNoteExport(validSecureNote));
|
||||
expect(result).toBeDefined();
|
||||
expect(result).toBeInstanceOf(SecureNote);
|
||||
expect(result.type).toBe(validSecureNote.type);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user