mirror of
https://github.com/bitwarden/browser
synced 2026-01-27 14:53:44 +00:00
do not show badge/button in AC (#18489)
This commit is contained in:
@@ -193,6 +193,7 @@ export abstract class CipherReportComponent implements OnDestroy {
|
||||
formConfig,
|
||||
activeCollectionId,
|
||||
disableForm,
|
||||
isAdminConsoleAction: true,
|
||||
});
|
||||
|
||||
const result = await lastValueFrom(this.vaultItemDialogRef.closed);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{{ title }}
|
||||
</span>
|
||||
|
||||
@if (isCipherArchived) {
|
||||
@if (isCipherArchived && !params.isAdminConsoleAction) {
|
||||
<span bitBadge bitDialogHeaderEnd> {{ "archived" | i18n }} </span>
|
||||
}
|
||||
|
||||
|
||||
@@ -303,6 +303,25 @@ describe("VaultItemDialogComponent", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("archive badge", () => {
|
||||
it('should show "archived" badge when the item is archived and not an admin console action', () => {
|
||||
component.setTestCipher({ isArchived: true });
|
||||
component.setTestParams({ mode: "view" });
|
||||
fixture.detectChanges();
|
||||
const archivedBadge = fixture.debugElement.query(By.css("span[bitBadge]"));
|
||||
expect(archivedBadge).toBeTruthy();
|
||||
expect(archivedBadge.nativeElement.textContent.trim()).toBe("archived");
|
||||
});
|
||||
|
||||
it('should not show "archived" badge when the item is archived and is an admin console action', () => {
|
||||
component.setTestCipher({ isArchived: true });
|
||||
component.setTestParams({ mode: "view", isAdminConsoleAction: true });
|
||||
fixture.detectChanges();
|
||||
const archivedBadge = fixture.debugElement.query(By.css("span[bitBadge]"));
|
||||
expect(archivedBadge).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
||||
describe("submitButtonText$", () => {
|
||||
it("should return 'unArchiveAndSave' when premium is false and cipher is archived", (done) => {
|
||||
jest.spyOn(component as any, "userHasPremium$", "get").mockReturnValue(of(false));
|
||||
|
||||
Reference in New Issue
Block a user