Skip to content

Commit

Permalink
chore(deps): bump js-lib to latest (DEV-669) (#687)
Browse files Browse the repository at this point in the history
* 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 b4836b8
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 18 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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",
Expand Down
15 changes: 8 additions & 7 deletions src/app/main/error/error-handler.service.spec.ts
Expand Up @@ -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';
Expand Down Expand Up @@ -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
}
]
});
Expand All @@ -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);
}
);
Expand Down
18 changes: 15 additions & 3 deletions src/app/main/error/error.component.spec.ts
@@ -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'])
}
};
Expand All @@ -19,6 +22,7 @@ describe('ErrorComponent', () => {
TestBed.configureTestingModule({
declarations: [ErrorComponent],
imports: [
BrowserAnimationsModule,
MatIconModule,
RouterTestingModule
],
Expand All @@ -29,7 +33,7 @@ describe('ErrorComponent', () => {
},
{
provide: DspApiConnectionToken,
useValue: systemEndpointSpyObj
useValue: apiEndpointSpyObj
},
]
})
Expand All @@ -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', () => {
Expand Down
2 changes: 2 additions & 0 deletions src/app/user/user.component.spec.ts
Expand Up @@ -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';
Expand Down Expand Up @@ -47,6 +48,7 @@ describe('UserComponent', () => {
UserComponent
],
imports: [
BrowserAnimationsModule,
MatButtonModule,
MatChipsModule,
MatDialogModule,
Expand Down

0 comments on commit b4836b8

Please sign in to comment.