mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 13:23:34 +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(routerMock.navigate).toHaveBeenCalledWith(["settings/subscription/premium"]);
|
||||||
expect(dialogServiceMock.openSimpleDialog).not.toHaveBeenCalled();
|
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", () => {
|
describe("when not self-hosted", () => {
|
||||||
|
|||||||
@@ -107,6 +107,9 @@ export class WebVaultPremiumUpgradePromptService implements PremiumUpgradePrompt
|
|||||||
|
|
||||||
private async redirectToSubscriptionPage() {
|
private async redirectToSubscriptionPage() {
|
||||||
await this.router.navigate([this.subscriptionPageRoute]);
|
await this.router.navigate([this.subscriptionPageRoute]);
|
||||||
|
if (this.dialog) {
|
||||||
|
this.dialog.close(VaultItemDialogResult.PremiumUpgrade);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async openUpgradeDialog(account: Account) {
|
private async openUpgradeDialog(account: Account) {
|
||||||
|
|||||||
Reference in New Issue
Block a user