From 343e5e4f3006a1c61b34caae8d88eac73780f28a Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Mon, 7 May 2018 16:37:09 +0200 Subject: [PATCH] Fixed tests --- .../notifications-board.component.spec.ts | 8 ++++++-- .../notifications/notifications.service.spec.ts | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/app/shared/notifications/notifications-board/notifications-board.component.spec.ts b/src/app/shared/notifications/notifications-board/notifications-board.component.spec.ts index 0ad4d89df1..808a404725 100644 --- a/src/app/shared/notifications/notifications-board/notifications-board.component.spec.ts +++ b/src/app/shared/notifications/notifications-board/notifications-board.component.spec.ts @@ -12,6 +12,7 @@ import { NotificationComponent } from '../notification/notification.component'; import { Notification } from '../models/notification.model'; import { NotificationType } from '../models/notification-type'; import { uniqueId } from 'lodash'; +import { INotificationBoardOptions } from '../../../../config/notifications-config.interfaces'; describe('NotificationsBoardComponent', () => { let comp: NotificationsBoardComponent; @@ -45,8 +46,11 @@ describe('NotificationsBoardComponent', () => { comp.options = { rtl: false, position: ['top', 'right'], - maxStack: 5 - }; + maxStack: 5, + timeOut: 5000, + clickToClose: true, + animate: 'scale' + } as INotificationBoardOptions; fixture.detectChanges(); })); diff --git a/src/app/shared/notifications/notifications.service.spec.ts b/src/app/shared/notifications/notifications.service.spec.ts index 534e6d0511..e5af2860a1 100644 --- a/src/app/shared/notifications/notifications.service.spec.ts +++ b/src/app/shared/notifications/notifications.service.spec.ts @@ -9,6 +9,7 @@ import 'rxjs/add/observable/of'; import { NewNotificationAction, RemoveAllNotificationsAction, RemoveNotificationAction } from './notifications.actions'; import { Notification } from './models/notification.model'; import { NotificationType } from './models/notification-type'; +import { GlobalConfig } from '../../../config/global-config.interface'; describe('NotificationsService test', () => { const store: Store = jasmine.createSpyObj('store', { @@ -16,6 +17,7 @@ describe('NotificationsService test', () => { select: Observable.of(true) }); let service; + let envConfig: GlobalConfig; beforeEach(async () => { TestBed.configureTestingModule({ @@ -26,7 +28,18 @@ describe('NotificationsService test', () => { ] }); - service = new NotificationsService(store); + envConfig = { + notifications: { + rtl: false, + position: ['top', 'right'], + maxStack: 8, + timeOut: 5000, + clickToClose: true, + animate: 'scale' + }, + } as any; + + service = new NotificationsService(envConfig, store); }); it('Success method should dispatch NewNotificationAction with proper parameter', () => {