mirror of
https://github.com/sartography/cr-connect-bpmn.git
synced 2025-02-23 05:38:25 +00:00
Fixes broken tests, build warnings, and deprecated TestBed.get errors
This commit is contained in:
parent
a3b3a69096
commit
cc4fe0df86
@ -54,7 +54,7 @@ describe('OpenFileDialogComponent', () => {
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
httpMock = TestBed.get(HttpTestingController);
|
||||
httpMock = TestBed.inject(HttpTestingController);
|
||||
fixture = TestBed.createComponent(OpenFileDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
|
@ -3,6 +3,7 @@ import {MatIconModule} from '@angular/material/icon';
|
||||
import {MatMenuModule} from '@angular/material/menu';
|
||||
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
||||
import {RouterTestingModule} from '@angular/router/testing';
|
||||
import {MockEnvironment} from 'sartography-workflow-lib';
|
||||
|
||||
import {AppComponent} from './app.component';
|
||||
import {FooterComponent} from './footer/footer.component';
|
||||
@ -24,7 +25,10 @@ describe('AppComponent', () => {
|
||||
MatIconModule,
|
||||
MatMenuModule,
|
||||
RouterTestingModule,
|
||||
]
|
||||
],
|
||||
providers: [
|
||||
{provide: 'APP_ENVIRONMENT', useClass: MockEnvironment},
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
@ -30,7 +30,7 @@ describe('DiagramComponent', () => {
|
||||
]
|
||||
});
|
||||
|
||||
httpMock = TestBed.get(HttpTestingController);
|
||||
httpMock = TestBed.inject(HttpTestingController);
|
||||
fixture = TestBed.createComponent(DiagramComponent);
|
||||
component = fixture.debugElement.componentInstance;
|
||||
component.fileName = '';
|
||||
|
@ -67,7 +67,7 @@ describe('FileListComponent', () => {
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(FileListComponent);
|
||||
component = fixture.componentInstance;
|
||||
httpMock = TestBed.get(HttpTestingController);
|
||||
httpMock = TestBed.inject(HttpTestingController);
|
||||
component.workflowSpec = mockWorkflowSpec0;
|
||||
fixture.detectChanges();
|
||||
|
||||
|
@ -101,7 +101,7 @@ describe('ModelerComponent', () => {
|
||||
}
|
||||
})
|
||||
.compileComponents();
|
||||
httpMock = TestBed.get(HttpTestingController);
|
||||
httpMock = TestBed.inject(HttpTestingController);
|
||||
fixture = TestBed.createComponent(ModelerComponent);
|
||||
component = fixture.debugElement.componentInstance;
|
||||
component.diagramComponent = TestBed.createComponent(DiagramComponent).componentInstance;
|
||||
@ -238,8 +238,9 @@ describe('ModelerComponent', () => {
|
||||
});
|
||||
|
||||
it('should update the diagram file on change', () => {
|
||||
const initialValue = component.diagramComponent.value;
|
||||
expect(initialValue).toBeTruthy();
|
||||
const valBefore = '';
|
||||
component.diagramComponent.writeValue(valBefore);
|
||||
expect(component.diagramComponent.value).toEqual(valBefore);
|
||||
|
||||
const newValue = '<xml>newExpectedValue</xml>';
|
||||
component.diagramComponent.writeValue(newValue);
|
||||
@ -249,6 +250,10 @@ describe('ModelerComponent', () => {
|
||||
});
|
||||
|
||||
it('should save file changes when existing diagram is modified and then saved', () => {
|
||||
const valBefore = '';
|
||||
component.diagramComponent.writeValue(valBefore);
|
||||
expect(component.diagramComponent.value).toEqual(valBefore);
|
||||
|
||||
const saveFileChangesSpy = spyOn(component, 'saveFileChanges').and.stub();
|
||||
const editFileMetaSpy = spyOn(component, 'editFileMeta').and.stub();
|
||||
|
||||
|
@ -39,7 +39,7 @@ describe('NavbarComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
localStorage.setItem('token', 'some_token');
|
||||
httpMock = TestBed.get(HttpTestingController);
|
||||
httpMock = TestBed.inject(HttpTestingController);
|
||||
fixture = TestBed.createComponent(NavbarComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
|
@ -58,7 +58,7 @@ describe('SignInComponent', () => {
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
httpMock = TestBed.get(HttpTestingController);
|
||||
httpMock = TestBed.inject(HttpTestingController);
|
||||
fixture = TestBed.createComponent(SignInComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
|
@ -26,7 +26,7 @@ describe('SignOutComponent', () => {
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
httpMock = TestBed.get(HttpTestingController);
|
||||
httpMock = TestBed.inject(HttpTestingController);
|
||||
fixture = TestBed.createComponent(SignOutComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
|
@ -71,7 +71,7 @@ describe('WorkflowSpecListComponent', () => {
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(WorkflowSpecListComponent);
|
||||
component = fixture.componentInstance;
|
||||
httpMock = TestBed.get(HttpTestingController);
|
||||
httpMock = TestBed.inject(HttpTestingController);
|
||||
fixture.detectChanges();
|
||||
|
||||
const sReq = httpMock.expectOne('apiRoot/workflow-specification');
|
||||
|
@ -22,5 +22,12 @@
|
||||
"resolveJsonModule": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"esModuleInterop": true
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"src/main.ts",
|
||||
"src/polyfills.ts"
|
||||
],
|
||||
"include": [
|
||||
"src/**/*.d.ts"
|
||||
]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user