Skip to content

Commit b4836b8

Browse files
authored
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
1 parent 76233ea commit b4836b8

5 files changed

Lines changed: 33 additions & 18 deletions

File tree

‎package-lock.json‎

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@angular/platform-browser-dynamic": "^13.2.6",
3434
"@angular/router": "^13.2.6",
3535
"@ckeditor/ckeditor5-angular": "^2.0.2",
36-
"@dasch-swiss/dsp-js": "^7.0.0",
36+
"@dasch-swiss/dsp-js": "^7.0.1",
3737
"@datadog/browser-rum": "^3.11.0",
3838
"@ngx-translate/core": "^13.0.0",
3939
"@ngx-translate/http-loader": "6.0.0",

‎src/app/main/error/error-handler.service.spec.ts‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/
33
import { TestBed } from '@angular/core/testing';
44
import { MatDialog, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
55
import { MatSnackBarModule } from '@angular/material/snack-bar';
6-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
6+
import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations';
77
import { HealthEndpointSystem, MockHealth } from '@dasch-swiss/dsp-js';
88
import { of } from 'rxjs';
99
import { DspApiConnectionToken } from '../declarations/dsp-api-tokens';
@@ -33,16 +33,17 @@ describe('ErrorHandlerService', () => {
3333
BrowserAnimationsModule,
3434
HttpClientTestingModule,
3535
MatDialogModule,
36-
MatSnackBarModule
36+
MatSnackBarModule,
37+
NoopAnimationsModule
3738
],
3839
providers: [
39-
{
40-
provide: DspApiConnectionToken,
41-
useValue: apiEndpointSpyObj
42-
},
4340
{
4441
provide: MatDialog,
4542
useValue: { open: () => of({ id: 1 }) }
43+
},
44+
{
45+
provide: DspApiConnectionToken,
46+
useValue: apiEndpointSpyObj
4647
}
4748
]
4849
});
@@ -53,7 +54,7 @@ describe('ErrorHandlerService', () => {
5354
const dspConnSpy = TestBed.inject(DspApiConnectionToken);
5455
(dspConnSpy.system.healthEndpoint as jasmine.SpyObj<HealthEndpointSystem>).getHealthStatus.and.callFake(
5556
() => {
56-
const health = MockHealth.mockStopped();
57+
const health = MockHealth.mockRunning();
5758
return of(health);
5859
}
5960
);

‎src/app/main/error/error.component.spec.ts‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
22
import { MatDialogRef } from '@angular/material/dialog';
33
import { MatIconModule } from '@angular/material/icon';
4+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
45
import { RouterTestingModule } from '@angular/router/testing';
6+
import { HealthEndpointSystem, MockHealth } from '@dasch-swiss/dsp-js';
7+
import { of } from 'rxjs';
58
import { DspApiConnectionToken } from '../declarations/dsp-api-tokens';
69
import { ErrorComponent } from './error.component';
710

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

12-
const systemEndpointSpyObj = {
13-
health: {
15+
const apiEndpointSpyObj = {
16+
system: {
1417
healthEndpoint: jasmine.createSpyObj('healthEndpoint', ['getHealthStatus'])
1518
}
1619
};
@@ -19,6 +22,7 @@ describe('ErrorComponent', () => {
1922
TestBed.configureTestingModule({
2023
declarations: [ErrorComponent],
2124
imports: [
25+
BrowserAnimationsModule,
2226
MatIconModule,
2327
RouterTestingModule
2428
],
@@ -29,7 +33,7 @@ describe('ErrorComponent', () => {
2933
},
3034
{
3135
provide: DspApiConnectionToken,
32-
useValue: systemEndpointSpyObj
36+
useValue: apiEndpointSpyObj
3337
},
3438
]
3539
})
@@ -40,6 +44,14 @@ describe('ErrorComponent', () => {
4044
fixture = TestBed.createComponent(ErrorComponent);
4145
component = fixture.componentInstance;
4246
fixture.detectChanges();
47+
48+
const dspConnSpy = TestBed.inject(DspApiConnectionToken);
49+
(dspConnSpy.system.healthEndpoint as jasmine.SpyObj<HealthEndpointSystem>).getHealthStatus.and.callFake(
50+
() => {
51+
const health = MockHealth.mockRunning();
52+
return of(health);
53+
}
54+
);
4355
});
4456

4557
it('should create', () => {

‎src/app/user/user.component.spec.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { MatInputModule } from '@angular/material/input';
1010
import { MatMenuModule } from '@angular/material/menu';
1111
import { MatSnackBarModule } from '@angular/material/snack-bar';
1212
import { MatTabsModule } from '@angular/material/tabs';
13+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
1314
import { ActivatedRoute } from '@angular/router';
1415
import { RouterTestingModule } from '@angular/router/testing';
1516
import { KnoraApiConnection } from '@dasch-swiss/dsp-js';
@@ -47,6 +48,7 @@ describe('UserComponent', () => {
4748
UserComponent
4849
],
4950
imports: [
51+
BrowserAnimationsModule,
5052
MatButtonModule,
5153
MatChipsModule,
5254
MatDialogModule,

0 commit comments

Comments
 (0)