mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
[PM-27854] close dialog when redirecting to premium page (#17243)
This commit is contained in:
@@ -187,6 +187,13 @@ describe("WebVaultPremiumUpgradePromptService", () => {
|
||||
expect(routerMock.navigate).toHaveBeenCalledWith(["settings/subscription/premium"]);
|
||||
expect(dialogServiceMock.openSimpleDialog).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("should close dialog when redirecting to subscription page", async () => {
|
||||
await service.promptForPremium();
|
||||
|
||||
expect(dialogRefMock.close).toHaveBeenCalledWith(VaultItemDialogResult.PremiumUpgrade);
|
||||
expect(routerMock.navigate).toHaveBeenCalledWith(["settings/subscription/premium"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("when not self-hosted", () => {
|
||||
|
||||
@@ -107,6 +107,9 @@ export class WebVaultPremiumUpgradePromptService implements PremiumUpgradePrompt
|
||||
|
||||
private async redirectToSubscriptionPage() {
|
||||
await this.router.navigate([this.subscriptionPageRoute]);
|
||||
if (this.dialog) {
|
||||
this.dialog.close(VaultItemDialogResult.PremiumUpgrade);
|
||||
}
|
||||
}
|
||||
|
||||
private async openUpgradeDialog(account: Account) {
|
||||
|
||||
Reference in New Issue
Block a user