1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-16 00:24:52 +00:00

initialize id in folder constructor. fix failing tests

This commit is contained in:
jaasen-livefront
2025-11-20 21:56:15 -08:00
parent ab47d10038
commit cfb3218065
2 changed files with 4 additions and 3 deletions

View File

@@ -60,8 +60,8 @@ describe("Folder", () => {
it("initializes empty properties when no FolderData is provided", () => {
const folder = new Folder();
expect(folder.id).toBe(undefined);
expect(folder.name).toBe(undefined);
expect(folder.id).toBe("");
expect(folder.name).toBeInstanceOf(EncString);
expect(folder.revisionDate).toBeInstanceOf(Date);
});
});
@@ -74,7 +74,7 @@ describe("Folder", () => {
const revisionDate = new Date("2022-08-04T01:06:40.441Z");
const actual = Folder.fromJSON({
revisionDate: revisionDate.toISOString(),
name: "name",
name: "name_fromJSON",
id: "id",
});

View File

@@ -18,6 +18,7 @@ export class Folder extends Domain {
return;
}
this.id = obj.id;
this.name = new EncString(obj.name);
this.revisionDate = new Date(obj.revisionDate);
}