90252: Remove old cleanup code

& add tests to confirm that DataService.delete is called
This commit is contained in:
Yura Bondarenko
2022-04-13 12:03:27 +02:00
parent c19d12c5c0
commit 9699491269
25 changed files with 333 additions and 165 deletions

View File

@@ -68,7 +68,6 @@ describe('DeleteComColPageComponent', () => {
{
delete: createNoContentRemoteDataObject$(),
findByHref: jasmine.createSpy('findByHref'),
refreshCache: jasmine.createSpy('refreshCache')
});
routerStub = {
@@ -79,10 +78,6 @@ describe('DeleteComColPageComponent', () => {
data: observableOf(community)
};
requestServiceStub = jasmine.createSpyObj('RequestService', {
removeByHrefSubstring: jasmine.createSpy('removeByHrefSubstring')
});
translateServiceStub = jasmine.createSpyObj('TranslateService', {
instant: jasmine.createSpy('instant')
});
@@ -99,7 +94,6 @@ describe('DeleteComColPageComponent', () => {
{ provide: ActivatedRoute, useValue: routeStub },
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
{ provide: TranslateService, useValue: translateServiceStub },
{ provide: RequestService, useValue: requestServiceStub }
],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents();
@@ -159,7 +153,6 @@ describe('DeleteComColPageComponent', () => {
scheduler.flush();
fixture.detectChanges();
expect(notificationsService.error).toHaveBeenCalled();
expect(dsoDataService.refreshCache).not.toHaveBeenCalled();
expect(router.navigate).toHaveBeenCalled();
});
@@ -169,7 +162,6 @@ describe('DeleteComColPageComponent', () => {
scheduler.flush();
fixture.detectChanges();
expect(notificationsService.success).toHaveBeenCalled();
expect(dsoDataService.refreshCache).toHaveBeenCalled();
expect(router.navigate).toHaveBeenCalled();
});