mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-04-16 14:38:52 +00:00
Fix for unit tests
This commit is contained in:
parent
7ca696643f
commit
6a21b88a4a
@ -58,9 +58,9 @@ describe('ProgressComponent', () => {
|
||||
});
|
||||
|
||||
it('should set error state when error defined', () => {
|
||||
const error = new Error('test');
|
||||
const error = {error: 'test'};
|
||||
progressService.setError(error);
|
||||
expect(component.error).toEqual(error);
|
||||
expect(component.error).toEqual(error.error);
|
||||
});
|
||||
|
||||
it('should clear error when changes route', () => {
|
||||
|
@ -10,7 +10,7 @@ import { Subscription } from 'rxjs';
|
||||
})
|
||||
export class ProgressComponent implements OnInit, OnDestroy {
|
||||
visible = false;
|
||||
error: Error;
|
||||
error: any;
|
||||
routerSubscription: Subscription;
|
||||
|
||||
constructor(private progressService: ProgressService, private router: Router) {}
|
||||
|
@ -30,9 +30,9 @@ describe('ProgressService', () => {
|
||||
});
|
||||
|
||||
it('should propagate event on error', () => {
|
||||
const error = new Error();
|
||||
const error = {error: 'Error'};
|
||||
progressService.setError(error);
|
||||
expect(progressService.state.next).toHaveBeenCalledWith(new State(false, error));
|
||||
expect(progressService.state.next).toHaveBeenCalledWith(new State(false, error.error));
|
||||
});
|
||||
|
||||
it('should clear an error', () => {
|
||||
|
@ -4,10 +4,10 @@ import { BehaviorSubject } from 'rxjs';
|
||||
|
||||
export class State {
|
||||
public visible: boolean;
|
||||
public error: Error;
|
||||
public error: any;
|
||||
public clear: boolean;
|
||||
|
||||
constructor(visible: boolean, error?: Error, clear: boolean = false) {
|
||||
constructor(visible: boolean, error?: any, clear: boolean = false) {
|
||||
this.visible = visible;
|
||||
this.error = error;
|
||||
this.clear = clear;
|
||||
|
Loading…
x
Reference in New Issue
Block a user