1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-29 15:53:45 +00:00

remove unarchive button when a cipher is deleted

This commit is contained in:
Nick Krantz
2026-01-26 15:43:16 -06:00
parent 36b648f5d7
commit e1070d2436
2 changed files with 14 additions and 2 deletions

View File

@@ -26,7 +26,7 @@
</button>
}
<ng-container slot="end">
@if ((archiveFlagEnabled$ | async) && cipher.isArchived) {
@if ((archiveFlagEnabled$ | async) && cipher.isArchived && !cipher.isDeleted) {
<button
type="button"
[bitAction]="unarchive"

View File

@@ -469,7 +469,7 @@ describe("ViewV2Component", () => {
describe("unarchive button", () => {
it("shows the unarchive button when the cipher is archived", fakeAsync(() => {
component.cipher = { ...mockCipher, isArchived: true } as CipherView;
component.cipher = { ...mockCipher, isArchived: true, isDeleted: false } as CipherView;
tick();
fixture.detectChanges();
@@ -491,6 +491,18 @@ describe("ViewV2Component", () => {
);
expect(unarchiveBtn).toBeFalsy();
}));
it("does not show the unarchive button when the cipher is deleted", fakeAsync(() => {
component.cipher = { ...mockCipher, isArchived: true, isDeleted: true } as CipherView;
tick();
fixture.detectChanges();
const unarchiveBtn = fixture.debugElement.query(
By.css("button[biticonbutton='bwi-unarchive']"),
);
expect(unarchiveBtn).toBeFalsy();
}));
});
describe("archive", () => {