Merge remote-tracking branch '4sciencebitbucket/DURACOM-133' into DURACOM-133

This commit is contained in:
Giuseppe Digilio
2023-05-19 18:33:20 +02:00
2 changed files with 9 additions and 10 deletions

View File

@@ -194,8 +194,9 @@ describe('CommunityListComponent', () => {
},
}),
CdkTreeModule,
RouterTestingModule],
declarations: [CommunityListComponent, RouterLinkWithHref],
RouterTestingModule,
RouterLinkWithHref],
declarations: [CommunityListComponent],
providers: [CommunityListComponent,
{ provide: CommunityListService, useValue: communityListServiceStub },],
schemas: [CUSTOM_ELEMENTS_SCHEMA],

View File

@@ -6,7 +6,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { WorkspaceItemsDeletePageComponent } from './workspaceitems-delete-page.component';
import { ActivatedRoute, Router } from '@angular/router';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { NgbModalModule } from '@ng-bootstrap/ng-bootstrap';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
import { EventEmitter, NO_ERRORS_SCHEMA } from '@angular/core';
@@ -40,13 +40,12 @@ describe('WorkspaceitemsDeletePageComponent', () => {
onDefaultLangChange: new EventEmitter()
};
const modalService = {
open: () => {/** empty */},
};
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [TranslateModule.forRoot()],
imports: [
NgbModalModule,
TranslateModule.forRoot()
],
declarations: [WorkspaceItemsDeletePageComponent],
providers: [
{
@@ -65,7 +64,6 @@ describe('WorkspaceitemsDeletePageComponent', () => {
useValue: workspaceitemDataServiceSpy,
},
{ provide: Location, useValue: new LocationStub() },
{ provide: NgbModal, useValue: modalService },
{
provide: NotificationsService,
useValue: new NotificationsServiceStub(),
@@ -94,7 +92,7 @@ describe('WorkspaceitemsDeletePageComponent', () => {
});
it('should delete the target workspace item', () => {
spyOn((component as any).modalService, 'open').and.returnValue({});
spyOn((component as any).modalService, 'open').and.returnValue({result: Promise.resolve('ok')});
component.confirmDelete(By.css('#delete-modal'));
fixture.detectChanges();
expect((component as any).modalService.open).toHaveBeenCalled();