diff --git a/apps/web/src/app/vault/org-vault/services/admin-console-cipher-form-config.service.spec.ts b/apps/web/src/app/vault/org-vault/services/admin-console-cipher-form-config.service.spec.ts index e490a9e6676..969088ffb0e 100644 --- a/apps/web/src/app/vault/org-vault/services/admin-console-cipher-form-config.service.spec.ts +++ b/apps/web/src/app/vault/org-vault/services/admin-console-cipher-form-config.service.spec.ts @@ -26,6 +26,8 @@ describe("AdminConsoleCipherFormConfigService", () => { beforeEach(async () => { getCipherAdmin.mockClear(); getCipher.mockClear(); + getCipher.mockResolvedValue({ id: cipherId, name: "Test Cipher - (non-admin)" }); + getCipherAdmin.mockResolvedValue({ id: cipherId, name: "Test Cipher - (admin)" }); await TestBed.configureTestingModule({ providers: [ @@ -101,7 +103,6 @@ describe("AdminConsoleCipherFormConfigService", () => { describe("getCipher", () => { it("retrieves the cipher from the cipher service", async () => { - getCipher.mockResolvedValueOnce({ id: cipherId, name: "Test Cipher - (non-admin)" }); testOrg.canEditAllCiphers = false; adminConsoleConfigService = TestBed.inject(AdminConsoleCipherFormConfigService); @@ -116,6 +117,7 @@ describe("AdminConsoleCipherFormConfigService", () => { }); it("retrieves the cipher from the admin service", async () => { + getCipher.mockResolvedValueOnce(null); getCipherAdmin.mockResolvedValue({ id: cipherId, name: "Test Cipher - (admin)" }); adminConsoleConfigService = TestBed.inject(AdminConsoleCipherFormConfigService); diff --git a/apps/web/src/app/vault/org-vault/services/admin-console-cipher-form-config.service.ts b/apps/web/src/app/vault/org-vault/services/admin-console-cipher-form-config.service.ts index 61152d2aca1..ad24459efd3 100644 --- a/apps/web/src/app/vault/org-vault/services/admin-console-cipher-form-config.service.ts +++ b/apps/web/src/app/vault/org-vault/services/admin-console-cipher-form-config.service.ts @@ -98,8 +98,9 @@ export class AdminConsoleCipherFormConfigService implements CipherFormConfigServ // Retrieve the cipher through the means of an admin const cipherResponse = await this.apiService.getCipherAdmin(id); - const cipherData = new CipherData(cipherResponse); + cipherResponse.edit = true; + const cipherData = new CipherData(cipherResponse); return new Cipher(cipherData); } }