Fixed tests

This commit is contained in:
Giuseppe Digilio
2018-05-07 16:37:09 +02:00
parent ada577c2be
commit 343e5e4f30
2 changed files with 20 additions and 3 deletions

View File

@@ -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();
}));

View File

@@ -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<Notification> = 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', () => {