Skip to content

Commit

Permalink
ci: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
QuCMGisaia committed Nov 14, 2024
1 parent 8dae896 commit d3102f4
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 18 deletions.
8 changes: 5 additions & 3 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { MatTooltipModule } from '@angular/material/tooltip';
import { RouterTestingModule } from '@angular/router/testing';
import { TranslateFakeLoader, TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { ArlasColorService, ColorGeneratorLoader } from 'arlas-web-components';
import { ArlasCollaborativesearchService, ArlasConfigService, ArlasSettingsService, ArlasStartupService } from 'arlas-wui-toolkit';
import { ArlasCollaborativesearchService, ArlasCollectionService, ArlasConfigService, ArlasSettingsService, ArlasStartupService } from 'arlas-wui-toolkit';

Check failure on line 29 in src/app/app.component.spec.ts

View workflow job for this annotation

GitHub Actions / Lint, Test, Build & Docker build

This line has a length of 155. Maximum allowed is 146
import { of } from 'rxjs';
import { ArlasWuiComponent } from './app.component';
import { ContributorService } from './services/contributors.service';
Expand All @@ -42,7 +42,8 @@ describe('ArlasWuiComponent', () => {
const mockArlasStartupService = jasmine.createSpyObj('ArlasStartupService', [], {
shouldRunApp: true,
emptyMode: false,
contributorRegistry: new Map()
contributorRegistry: new Map(),
collectionsMap: new Map()
});

const mockSettingsService = jasmine.createSpyObj('ArlasSettingsService', ['getHistogramMaxBucket']);
Expand Down Expand Up @@ -102,7 +103,8 @@ describe('ArlasWuiComponent', () => {
{
provide: ColorGeneratorLoader,
useValue: mockColorGeneratorLoader
}
},
ArlasCollectionService
]
}).compileComponents();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MAT_DIALOG_SCROLL_STRATEGY, MatDialog } from '@angular/material/dialog';
import { MatSnackBar } from '@angular/material/snack-bar';
import { RouterTestingModule } from '@angular/router/testing';
import { ArlasCollaborativesearchService, ArlasStartupService } from 'arlas-wui-toolkit';
import { ArlasCollaborativesearchService, ArlasCollectionService, ArlasStartupService } from 'arlas-wui-toolkit';
import { VisualizeService } from '../../services/visualize.service';
import { ArlasAnalyticsComponent } from './arlas-analytics.component';
import { TranslateModule, TranslateLoader, TranslateFakeLoader } from '@ngx-translate/core';
import { Overlay } from '@angular/cdk/overlay';
import { ResultlistService } from '@services/resultlist.service';

describe('ArlasAnalyticsComponent', () => {
let component: ArlasAnalyticsComponent;
Expand All @@ -18,7 +19,8 @@ describe('ArlasAnalyticsComponent', () => {
const mockArlasStartupService = jasmine.createSpyObj('ArlasStartupService', [], {
shouldRunApp: true,
emptyMode: false,
contributorRegistry: new Map()
contributorRegistry: new Map(),
collectionsMap: new Map()
});

await TestBed.configureTestingModule({
Expand Down Expand Up @@ -46,7 +48,8 @@ describe('ArlasAnalyticsComponent', () => {
provide: DIALOG_SCROLL_STRATEGY,
useValue: {}
},
Overlay
Overlay,
ArlasCollectionService
]
})
.compileComponents();
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/arlas-list/arlas-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class ArlasListComponent implements OnInit, OnDestroy, AfterViewInit {
public ngOnInit(): void { }

public ngAfterViewInit(): void {
this.tabsList.selectedIndexChange.pipe(takeUntil(this._onDestroy$)).subscribe(e => {
this.tabsList.selectedIndexChange?.pipe(takeUntil(this._onDestroy$)).subscribe(e => {
this.resultlistService.selectedListTabIndex = e;
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { ResultlistService } from 'app/services/resultlist.service';
import { VisualizeService } from 'app/services/visualize.service';
import { HistogramModule } from 'arlas-web-components';
import {
ArlasCollaborativesearchService, ArlasConfigService, ArlasSettingsService,
ArlasCollaborativesearchService, ArlasCollectionService, ArlasConfigService, ArlasSettingsService,
ArlasStartupService, ArlasTaggerModule, ArlasToolKitModule, ArlasToolkitSharedModule
} from 'arlas-wui-toolkit';
import { ArlasWuiRootComponent } from './arlas-wui-root.component';
Expand Down Expand Up @@ -86,11 +86,11 @@ describe('ArlasWuiRootComponent', () => {
{ provide: APP_BASE_HREF, useValue: '/' },
ResultlistService,
VisualizeService,
ArlasSettingsService,
{
provide: ArlasSettingsService,
useValue: mockSettingsService
}
},
ArlasCollectionService
],
teardown: { destroyAfterEach: false }
}).compileComponents();
Expand Down
23 changes: 15 additions & 8 deletions src/app/services/resultlist.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
import { Overlay, OverlayModule } from '@angular/cdk/overlay';
import { HttpClientModule } from '@angular/common/http';
import { TestBed } from '@angular/core/testing';

import { MatDialog, MatDialogModule } from '@angular/material/dialog';
import { MatSnackBar } from '@angular/material/snack-bar';
import { RouterTestingModule } from '@angular/router/testing';
import { ArlasCollaborativesearchService } from 'arlas-wui-toolkit';
import { TranslateFakeLoader, TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { ArlasCollaborativesearchService, ArlasCollectionService } from 'arlas-wui-toolkit';
import { ResultlistService } from './resultlist.service';
import { HttpClientModule } from '@angular/common/http';
import { TranslateModule, TranslateLoader, TranslateFakeLoader } from '@ngx-translate/core';
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
import { VisualizeService } from './visualize.service';
import { Overlay, OverlayModule } from '@angular/cdk/overlay';
import { MatDialog, MatDialogModule } from '@angular/material/dialog';


describe('ResultlistService', () => {
let service: ResultlistService;

beforeEach(() => {
const mockArlasCollectionService = jasmine.createSpyObj('ArlasCollectionService', [], {
appUnits: new Map()
});

TestBed.configureTestingModule({
imports: [
RouterTestingModule,
Expand All @@ -28,7 +31,11 @@ describe('ResultlistService', () => {
MatSnackBar,
VisualizeService,
Overlay,
MatDialog
MatDialog,
{
provide: ArlasCollectionService,
useValue: mockArlasCollectionService
}
],
teardown: { destroyAfterEach: false }
});
Expand Down

0 comments on commit d3102f4

Please sign in to comment.