fixing storybook tests.
This commit is contained in:
parent
bb9f4632b3
commit
d519684055
4
Makefile
4
Makefile
|
@ -83,3 +83,7 @@ test-frontend-coverage: dep-frontend
|
|||
# reduce logging, disable angular-cli analytics for ci environment
|
||||
test-frontend-coverage-ci: dep-frontend
|
||||
cd frontend && npx ng test --watch=false --code-coverage --browsers=ChromeHeadlessCI
|
||||
|
||||
.PHONY: test-frontend-storybook
|
||||
test-frontend-storybook:
|
||||
cd frontend && ng run fastenhealth:storybook
|
||||
|
|
|
@ -9,12 +9,16 @@ import {HttpClientTestingModule} from '@angular/common/http/testing';
|
|||
import {FastenApiService} from '../../services/fasten-api.service';
|
||||
import {DashboardWidgetQuery} from '../../models/widget/dashboard-widget-query';
|
||||
import {Observable, of} from 'rxjs';
|
||||
import { ResponseWrapper } from 'src/app/models/response-wrapper';
|
||||
|
||||
|
||||
class MockFastenApiService implements Partial<FastenApiService> {
|
||||
public queryResources(query?: DashboardWidgetQuery): Observable<any[]> {
|
||||
public queryResources(query?: DashboardWidgetQuery): Observable<ResponseWrapper> {
|
||||
console.log("CALLED MOCK")
|
||||
return of([])
|
||||
return of({
|
||||
data:{},
|
||||
success: true
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,12 +8,16 @@ import {CommonModule} from '@angular/common';
|
|||
import {FastenApiService} from '../../services/fasten-api.service';
|
||||
import {DashboardWidgetQuery} from '../../models/widget/dashboard-widget-query';
|
||||
import {Observable, of} from 'rxjs';
|
||||
import {ResponseWrapper} from '../../models/response-wrapper';
|
||||
|
||||
|
||||
class MockFastenApiService implements Partial<FastenApiService> {
|
||||
public queryResources(query?: DashboardWidgetQuery): Observable<any[]> {
|
||||
public queryResources(query?: DashboardWidgetQuery): Observable<ResponseWrapper> {
|
||||
console.log("CALLED MOCK")
|
||||
return of([])
|
||||
return of({
|
||||
data:{},
|
||||
success: true
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue