diff --git a/package-lock.json b/package-lock.json index 24fe0a7e1e..945148871f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@angular/platform-browser-dynamic": "^13.2.6", "@angular/router": "^13.2.6", "@ckeditor/ckeditor5-angular": "^2.0.2", - "@dasch-swiss/dsp-js": "^7.0.0", + "@dasch-swiss/dsp-js": "^7.0.1", "@datadog/browser-rum": "^3.11.0", "@ngx-translate/core": "^13.0.0", "@ngx-translate/http-loader": "6.0.0", @@ -2425,9 +2425,9 @@ } }, "node_modules/@dasch-swiss/dsp-js": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@dasch-swiss/dsp-js/-/dsp-js-7.0.0.tgz", - "integrity": "sha512-MM58ipXipltAPm0eAdjNZnCc3SzTE5U6HB+VhVGYP24/fk73ptcpMV6It0Axw9XlJNUh/+34DcpqA04l4T2hgA==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@dasch-swiss/dsp-js/-/dsp-js-7.0.1.tgz", + "integrity": "sha512-eJ9uIffaWCXe/IKPXj6fup0MGUJKKxbnr6izCdYHj4RIA2o8qXOhu0+VfBvuBlPzEi7V1g460PcG1Z02eJlroQ==", "dependencies": { "@babel/helper-compilation-targets": "^7.16.7", "@types/jsonld": "^1.5.6", @@ -17009,9 +17009,9 @@ } }, "@dasch-swiss/dsp-js": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@dasch-swiss/dsp-js/-/dsp-js-7.0.0.tgz", - "integrity": "sha512-MM58ipXipltAPm0eAdjNZnCc3SzTE5U6HB+VhVGYP24/fk73ptcpMV6It0Axw9XlJNUh/+34DcpqA04l4T2hgA==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@dasch-swiss/dsp-js/-/dsp-js-7.0.1.tgz", + "integrity": "sha512-eJ9uIffaWCXe/IKPXj6fup0MGUJKKxbnr6izCdYHj4RIA2o8qXOhu0+VfBvuBlPzEi7V1g460PcG1Z02eJlroQ==", "requires": { "@babel/helper-compilation-targets": "^7.16.7", "@types/jsonld": "^1.5.6", diff --git a/package.json b/package.json index 94e91937c7..20c2734ffd 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "@angular/platform-browser-dynamic": "^13.2.6", "@angular/router": "^13.2.6", "@ckeditor/ckeditor5-angular": "^2.0.2", - "@dasch-swiss/dsp-js": "^7.0.0", + "@dasch-swiss/dsp-js": "^7.0.1", "@datadog/browser-rum": "^3.11.0", "@ngx-translate/core": "^13.0.0", "@ngx-translate/http-loader": "6.0.0", diff --git a/src/app/main/error/error-handler.service.spec.ts b/src/app/main/error/error-handler.service.spec.ts index 4c841bd543..757d9de13d 100644 --- a/src/app/main/error/error-handler.service.spec.ts +++ b/src/app/main/error/error-handler.service.spec.ts @@ -3,7 +3,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/ import { TestBed } from '@angular/core/testing'; import { MatDialog, MatDialogModule, MatDialogRef } from '@angular/material/dialog'; import { MatSnackBarModule } from '@angular/material/snack-bar'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations'; import { HealthEndpointSystem, MockHealth } from '@dasch-swiss/dsp-js'; import { of } from 'rxjs'; import { DspApiConnectionToken } from '../declarations/dsp-api-tokens'; @@ -33,16 +33,17 @@ describe('ErrorHandlerService', () => { BrowserAnimationsModule, HttpClientTestingModule, MatDialogModule, - MatSnackBarModule + MatSnackBarModule, + NoopAnimationsModule ], providers: [ - { - provide: DspApiConnectionToken, - useValue: apiEndpointSpyObj - }, { provide: MatDialog, useValue: { open: () => of({ id: 1 }) } + }, + { + provide: DspApiConnectionToken, + useValue: apiEndpointSpyObj } ] }); @@ -53,7 +54,7 @@ describe('ErrorHandlerService', () => { const dspConnSpy = TestBed.inject(DspApiConnectionToken); (dspConnSpy.system.healthEndpoint as jasmine.SpyObj).getHealthStatus.and.callFake( () => { - const health = MockHealth.mockStopped(); + const health = MockHealth.mockRunning(); return of(health); } ); diff --git a/src/app/main/error/error.component.spec.ts b/src/app/main/error/error.component.spec.ts index bdf2699b3f..6fb38579fa 100644 --- a/src/app/main/error/error.component.spec.ts +++ b/src/app/main/error/error.component.spec.ts @@ -1,7 +1,10 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { MatDialogRef } from '@angular/material/dialog'; import { MatIconModule } from '@angular/material/icon'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; +import { HealthEndpointSystem, MockHealth } from '@dasch-swiss/dsp-js'; +import { of } from 'rxjs'; import { DspApiConnectionToken } from '../declarations/dsp-api-tokens'; import { ErrorComponent } from './error.component'; @@ -9,8 +12,8 @@ describe('ErrorComponent', () => { let component: ErrorComponent; let fixture: ComponentFixture; - const systemEndpointSpyObj = { - health: { + const apiEndpointSpyObj = { + system: { healthEndpoint: jasmine.createSpyObj('healthEndpoint', ['getHealthStatus']) } }; @@ -19,6 +22,7 @@ describe('ErrorComponent', () => { TestBed.configureTestingModule({ declarations: [ErrorComponent], imports: [ + BrowserAnimationsModule, MatIconModule, RouterTestingModule ], @@ -29,7 +33,7 @@ describe('ErrorComponent', () => { }, { provide: DspApiConnectionToken, - useValue: systemEndpointSpyObj + useValue: apiEndpointSpyObj }, ] }) @@ -40,6 +44,14 @@ describe('ErrorComponent', () => { fixture = TestBed.createComponent(ErrorComponent); component = fixture.componentInstance; fixture.detectChanges(); + + const dspConnSpy = TestBed.inject(DspApiConnectionToken); + (dspConnSpy.system.healthEndpoint as jasmine.SpyObj).getHealthStatus.and.callFake( + () => { + const health = MockHealth.mockRunning(); + return of(health); + } + ); }); it('should create', () => { diff --git a/src/app/user/user.component.spec.ts b/src/app/user/user.component.spec.ts index abdb6f4284..9b2af50c70 100644 --- a/src/app/user/user.component.spec.ts +++ b/src/app/user/user.component.spec.ts @@ -10,6 +10,7 @@ import { MatInputModule } from '@angular/material/input'; import { MatMenuModule } from '@angular/material/menu'; import { MatSnackBarModule } from '@angular/material/snack-bar'; import { MatTabsModule } from '@angular/material/tabs'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { KnoraApiConnection } from '@dasch-swiss/dsp-js'; @@ -47,6 +48,7 @@ describe('UserComponent', () => { UserComponent ], imports: [ + BrowserAnimationsModule, MatButtonModule, MatChipsModule, MatDialogModule,