component = fixture.componentInstance;
httpTesting = TestBed.get(HttpTestingController);
- component.metaType = 'RBD';
component.poolName = 'foo';
component.imageName = 'bar';
+
+ fixture.detectChanges();
});
it('should create', () => {
});
it('should finish running ngOnInit', () => {
- fixture.detectChanges();
expect(component.pattern).toEqual('foo/bar');
});
describe('should call moveImage', () => {
- let notificationService;
+ let notificationService: NotificationService;
beforeEach(() => {
notificationService = TestBed.get(NotificationService);
it('with normal delay', () => {
component.moveImage();
- const req = httpTesting.expectOne('api/block/image/foo/bar/move_trash');
+ const req = httpTesting.expectOne('api/block/image/foo%2Fbar/move_trash');
req.flush(null);
expect(req.request.body).toEqual({ delay: 0 });
});
component.moveForm.patchValue({ expiresAt: oldDate });
component.moveImage();
- const req = httpTesting.expectOne('api/block/image/foo/bar/move_trash');
+ const req = httpTesting.expectOne('api/block/image/foo%2Fbar/move_trash');
req.flush(null);
expect(req.request.body).toEqual({ delay: 0 });
});
const oldDate = moment()
.add(24, 'hour')
.toISOString();
- fixture.detectChanges();
component.moveForm.patchValue({ expiresAt: oldDate });
component.moveImage();
- const req = httpTesting.expectOne('api/block/image/foo/bar/move_trash');
+ const req = httpTesting.expectOne('api/block/image/foo%2Fbar/move_trash');
req.flush(null);
expect(req.request.body.delay).toBeGreaterThan(86390);
});