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:
@@ -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"
|
||||
|
||||
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user