1
0

[DURACOM-191] run optimize imports and lint fix

This commit is contained in:
Andrea Barbasso
2024-03-12 20:10:23 +01:00
parent fe23ac6a82
commit ee265f855b
1481 changed files with 23238 additions and 16561 deletions

View File

@@ -1,7 +1,15 @@
/* eslint-disable no-empty, @typescript-eslint/no-empty-function */
import { CommonModule } from '@angular/common';
import { Component, NO_ERRORS_SCHEMA, } from '@angular/core';
import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing';
import {
Component,
NO_ERRORS_SCHEMA,
} from '@angular/core';
import {
ComponentFixture,
inject,
TestBed,
waitForAsync,
} from '@angular/core/testing';
import { ActivatedRoute } from '@angular/router';
import { TranslateModule } from '@ngx-translate/core';
import { cold } from 'jasmine-marbles';
@@ -9,18 +17,18 @@ import { of as observableOf } from 'rxjs';
import { ItemDataService } from 'src/app/core/data/item-data.service';
import { PaginationService } from '../../../core/pagination/pagination.service';
import { AlertComponent } from '../../../shared/alert/alert.component';
import { LoadingComponent } from '../../../shared/loading/loading.component';
import {
getMockNotificationsStateService,
qualityAssuranceTopicObjectMoreAbstract,
qualityAssuranceTopicObjectMorePid,
} from '../../../shared/mocks/notifications.mock';
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
import { createTestComponent } from '../../../shared/testing/utils.test';
import { NotificationsStateService } from '../../notifications-state.service';
import { QualityAssuranceTopicsComponent } from './quality-assurance-topics.component';
import { AlertComponent } from '../../../shared/alert/alert.component';
import { LoadingComponent } from '../../../shared/loading/loading.component';
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
describe('QualityAssuranceTopicsComponent test suite', () => {
let fixture: ComponentFixture<QualityAssuranceTopicsComponent>;
@@ -37,47 +45,47 @@ describe('QualityAssuranceTopicsComponent test suite', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
imports: [
CommonModule,
TranslateModule.forRoot(),
QualityAssuranceTopicsComponent,
TestComponent
],
providers: [
TestComponent,
],
providers: [
{ provide: NotificationsStateService, useValue: mockNotificationsStateService },
{ provide: ActivatedRoute, useValue: { data: observableOf(activatedRouteParams), snapshot: {
params: {
sourceId: 'openaire',
targetId: null,
},
} } },
},
} } },
{ provide: PaginationService, useValue: paginationService },
{ provide: ItemDataService, useValue: {} },
QualityAssuranceTopicsComponent,
],
schemas: [NO_ERRORS_SCHEMA],
})
],
schemas: [NO_ERRORS_SCHEMA],
})
.overrideComponent(QualityAssuranceTopicsComponent, {
remove: {
imports: [
AlertComponent,
LoadingComponent,
PaginationComponent
]
}
PaginationComponent,
],
},
})
.compileComponents().then(() => {
mockNotificationsStateService.getQualityAssuranceTopics.and.returnValue(observableOf([
qualityAssuranceTopicObjectMorePid,
qualityAssuranceTopicObjectMoreAbstract,
]));
mockNotificationsStateService.getQualityAssuranceTopicsTotalPages.and.returnValue(observableOf(1));
mockNotificationsStateService.getQualityAssuranceTopicsCurrentPage.and.returnValue(observableOf(0));
mockNotificationsStateService.getQualityAssuranceTopicsTotals.and.returnValue(observableOf(2));
mockNotificationsStateService.isQualityAssuranceTopicsLoaded.and.returnValue(observableOf(true));
mockNotificationsStateService.isQualityAssuranceTopicsLoading.and.returnValue(observableOf(false));
mockNotificationsStateService.isQualityAssuranceTopicsProcessing.and.returnValue(observableOf(false));
});
mockNotificationsStateService.getQualityAssuranceTopics.and.returnValue(observableOf([
qualityAssuranceTopicObjectMorePid,
qualityAssuranceTopicObjectMoreAbstract,
]));
mockNotificationsStateService.getQualityAssuranceTopicsTotalPages.and.returnValue(observableOf(1));
mockNotificationsStateService.getQualityAssuranceTopicsCurrentPage.and.returnValue(observableOf(0));
mockNotificationsStateService.getQualityAssuranceTopicsTotals.and.returnValue(observableOf(2));
mockNotificationsStateService.isQualityAssuranceTopicsLoaded.and.returnValue(observableOf(true));
mockNotificationsStateService.isQualityAssuranceTopicsLoading.and.returnValue(observableOf(false));
mockNotificationsStateService.isQualityAssuranceTopicsProcessing.and.returnValue(observableOf(false));
});
}));
// First test to check the correct component creation
@@ -164,10 +172,10 @@ describe('QualityAssuranceTopicsComponent test suite', () => {
// declare a test component
@Component({
selector: 'ds-test-cmp',
template: ``,
standalone: true,
imports: [CommonModule]
selector: 'ds-test-cmp',
template: ``,
standalone: true,
imports: [CommonModule],
})
class TestComponent {