Skip to content
Permalink
Browse files
chore(deps): bump js-lib to latest (DEV-669) (#687)
* chore(deps): bump js-lib to latest (DEV-669)

* test(error): fix tests

* test(error): refactor test

* test(error): refactor test

* test(error): refactor test
  • Loading branch information
kilchenmann committed Mar 21, 2022
1 parent 76233ea commit b4836b856db2e0b4bd99d1c913e966820f226310
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 18 deletions.

Some generated files are not rendered by default. Learn more.

@@ -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",
@@ -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<HealthEndpointSystem>).getHealthStatus.and.callFake(
() => {
const health = MockHealth.mockStopped();
const health = MockHealth.mockRunning();
return of(health);
}
);
@@ -1,16 +1,19 @@
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';

describe('ErrorComponent', () => {
let component: ErrorComponent;
let fixture: ComponentFixture<ErrorComponent>;

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<HealthEndpointSystem>).getHealthStatus.and.callFake(
() => {
const health = MockHealth.mockRunning();
return of(health);
}
);
});

it('should create', () => {
@@ -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,

0 comments on commit b4836b8

Please sign in to comment.