From 1fab816e18594efa89104d761e8e5b15976eb03b Mon Sep 17 00:00:00 2001 From: kurilova Date: Thu, 1 Feb 2024 12:09:27 +0000 Subject: [PATCH] Set snack bar duration to 0 to prevent auto closing --- modules/ui/src/app/services/notification.service.spec.ts | 6 +++--- modules/ui/src/app/services/notification.service.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/ui/src/app/services/notification.service.spec.ts b/modules/ui/src/app/services/notification.service.spec.ts index 53cc73970..c2e35a4cf 100644 --- a/modules/ui/src/app/services/notification.service.spec.ts +++ b/modules/ui/src/app/services/notification.service.spec.ts @@ -50,9 +50,9 @@ describe('NotificationService', () => { expect(args[0]).toBe('something good happened'); expect(args[1]).toBe('OK'); expect(args[2]).toEqual({ - horizontalPosition: 'right', + horizontalPosition: 'center', panelClass: 'test-run-notification', - duration: 5000, + duration: 0, }); }); @@ -63,7 +63,7 @@ describe('NotificationService', () => { const args = matSnackBarSpy.calls.argsFor(0); expect(args[2]).toEqual({ - horizontalPosition: 'right', + horizontalPosition: 'center', panelClass: 'test-run-notification', duration: 15000, }); diff --git a/modules/ui/src/app/services/notification.service.ts b/modules/ui/src/app/services/notification.service.ts index 7daa17444..4715087c2 100644 --- a/modules/ui/src/app/services/notification.service.ts +++ b/modules/ui/src/app/services/notification.service.ts @@ -22,9 +22,9 @@ import { MatSnackBar } from '@angular/material/snack-bar'; export class NotificationService { constructor(private snackBar: MatSnackBar) {} - notify(message: string, duration = 5000) { + notify(message: string, duration = 0) { this.snackBar.open(message, 'OK', { - horizontalPosition: 'right', + horizontalPosition: 'center', panelClass: 'test-run-notification', duration: duration, });