mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-19 07:53:02 +00:00
Fixed tests
This commit is contained in:
@@ -12,6 +12,7 @@ import { NotificationComponent } from '../notification/notification.component';
|
|||||||
import { Notification } from '../models/notification.model';
|
import { Notification } from '../models/notification.model';
|
||||||
import { NotificationType } from '../models/notification-type';
|
import { NotificationType } from '../models/notification-type';
|
||||||
import { uniqueId } from 'lodash';
|
import { uniqueId } from 'lodash';
|
||||||
|
import { INotificationBoardOptions } from '../../../../config/notifications-config.interfaces';
|
||||||
|
|
||||||
describe('NotificationsBoardComponent', () => {
|
describe('NotificationsBoardComponent', () => {
|
||||||
let comp: NotificationsBoardComponent;
|
let comp: NotificationsBoardComponent;
|
||||||
@@ -45,8 +46,11 @@ describe('NotificationsBoardComponent', () => {
|
|||||||
comp.options = {
|
comp.options = {
|
||||||
rtl: false,
|
rtl: false,
|
||||||
position: ['top', 'right'],
|
position: ['top', 'right'],
|
||||||
maxStack: 5
|
maxStack: 5,
|
||||||
};
|
timeOut: 5000,
|
||||||
|
clickToClose: true,
|
||||||
|
animate: 'scale'
|
||||||
|
} as INotificationBoardOptions;
|
||||||
|
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
}));
|
}));
|
||||||
|
@@ -9,6 +9,7 @@ import 'rxjs/add/observable/of';
|
|||||||
import { NewNotificationAction, RemoveAllNotificationsAction, RemoveNotificationAction } from './notifications.actions';
|
import { NewNotificationAction, RemoveAllNotificationsAction, RemoveNotificationAction } from './notifications.actions';
|
||||||
import { Notification } from './models/notification.model';
|
import { Notification } from './models/notification.model';
|
||||||
import { NotificationType } from './models/notification-type';
|
import { NotificationType } from './models/notification-type';
|
||||||
|
import { GlobalConfig } from '../../../config/global-config.interface';
|
||||||
|
|
||||||
describe('NotificationsService test', () => {
|
describe('NotificationsService test', () => {
|
||||||
const store: Store<Notification> = jasmine.createSpyObj('store', {
|
const store: Store<Notification> = jasmine.createSpyObj('store', {
|
||||||
@@ -16,6 +17,7 @@ describe('NotificationsService test', () => {
|
|||||||
select: Observable.of(true)
|
select: Observable.of(true)
|
||||||
});
|
});
|
||||||
let service;
|
let service;
|
||||||
|
let envConfig: GlobalConfig;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
TestBed.configureTestingModule({
|
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', () => {
|
it('Success method should dispatch NewNotificationAction with proper parameter', () => {
|
||||||
|
Reference in New Issue
Block a user