[DURACOM-191] fix some tests

This commit is contained in:
Andrea Barbasso
2024-03-14 16:01:09 +01:00
parent c8ae352740
commit f0a0e38302
3 changed files with 11 additions and 3 deletions

View File

@@ -69,6 +69,7 @@ import { TruncatePipe } from '../../../../shared/utils/truncate.pipe';
import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component';
import { GenericItemPageFieldComponent } from '../../field-components/specific-field/generic/generic-item-page-field.component'; import { GenericItemPageFieldComponent } from '../../field-components/specific-field/generic/generic-item-page-field.component';
import { ThemedItemPageTitleFieldComponent } from '../../field-components/specific-field/title/themed-item-page-field.component'; import { ThemedItemPageTitleFieldComponent } from '../../field-components/specific-field/title/themed-item-page-field.component';
import { ThemedMetadataRepresentationListComponent } from '../../metadata-representation-list/themed-metadata-representation-list.component';
import { TabbedRelatedEntitiesSearchComponent } from '../../related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component'; import { TabbedRelatedEntitiesSearchComponent } from '../../related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component';
import { RelatedItemsComponent } from '../../related-items/related-items-component'; import { RelatedItemsComponent } from '../../related-items/related-items-component';
import { ItemComponent } from './item.component'; import { ItemComponent } from './item.component';
@@ -198,6 +199,7 @@ export function getItemPageFieldsTest(mockItem: Item, component) {
ThemedThumbnailComponent, ThemedThumbnailComponent,
RelatedItemsComponent, RelatedItemsComponent,
TabbedRelatedEntitiesSearchComponent, TabbedRelatedEntitiesSearchComponent,
ThemedMetadataRepresentationListComponent,
], ],
}, },
add: { changeDetection: ChangeDetectionStrategy.Default }, add: { changeDetection: ChangeDetectionStrategy.Default },

View File

@@ -6,6 +6,7 @@ import { ActivatedRoute } from '@angular/router';
import { APP_CONFIG } from '../../../../../config/app-config.interface'; import { APP_CONFIG } from '../../../../../config/app-config.interface';
import { environment } from '../../../../../environments/environment.test'; import { environment } from '../../../../../environments/environment.test';
import { ThemedSearchComponent } from '../../../search/themed-search.component';
import { ActivatedRouteStub } from '../../../testing/active-router.stub'; import { ActivatedRouteStub } from '../../../testing/active-router.stub';
import { ComcolSearchSectionComponent } from './comcol-search-section.component'; import { ComcolSearchSectionComponent } from './comcol-search-section.component';
@@ -24,7 +25,13 @@ describe('ComcolSearchSectionComponent', () => {
{ provide: APP_CONFIG, useValue: environment }, { provide: APP_CONFIG, useValue: environment },
{ provide: ActivatedRoute, useValue: route }, { provide: ActivatedRoute, useValue: route },
], ],
}).compileComponents(); })
.overrideComponent(ComcolSearchSectionComponent, {
remove: {
imports: [ThemedSearchComponent],
},
})
.compileComponents();
fixture = TestBed.createComponent(ComcolSearchSectionComponent); fixture = TestBed.createComponent(ComcolSearchSectionComponent);
component = fixture.componentInstance; component = fixture.componentInstance;

View File

@@ -22,8 +22,7 @@ describe('NotificationBoxComponent', () => {
}; };
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
imports: [TranslateModule.forRoot()], imports: [TranslateModule.forRoot(), NotificationBoxComponent],
declarations: [NotificationBoxComponent],
}) })
.compileComponents(); .compileComponents();