1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

[PM-19826] - browser - clear history after creating new cipher (#14894)

* browser - clear history after creating new cipher

* fix tests
This commit is contained in:
Jordan Aasen
2025-06-03 15:04:46 -07:00
committed by GitHub
parent 9aaeacf2be
commit dcd6f7ada8
2 changed files with 4 additions and 1 deletions

View File

@@ -51,6 +51,7 @@ describe("AddEditV2Component", () => {
const disable = jest.fn();
const navigate = jest.fn();
const back = jest.fn().mockResolvedValue(null);
const setHistory = jest.fn();
const collect = jest.fn().mockResolvedValue(null);
beforeEach(async () => {
@@ -70,7 +71,7 @@ describe("AddEditV2Component", () => {
providers: [
{ provide: PlatformUtilsService, useValue: mock<PlatformUtilsService>() },
{ provide: ConfigService, useValue: mock<ConfigService>() },
{ provide: PopupRouterCacheService, useValue: { back } },
{ provide: PopupRouterCacheService, useValue: { back, setHistory } },
{ provide: PopupCloseWarningService, useValue: { disable } },
{ provide: Router, useValue: { navigate } },
{ provide: ActivatedRoute, useValue: { queryParams: queryParams$ } },

View File

@@ -265,6 +265,8 @@ export class AddEditV2Component implements OnInit {
replaceUrl: true,
queryParams: { cipherId: cipher.id },
});
// Clear popup history so after closing/reopening, Back wont return to the add-edit form
await this.popupRouterCacheService.setHistory([]);
}
}