fixing storybook tests.

This commit is contained in:
Jason Kulatunga 2023-09-05 20:30:21 -07:00
parent bb9f4632b3
commit d519684055
No known key found for this signature in database
3 changed files with 16 additions and 4 deletions

View File

@ -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

View File

@ -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
})
}
}

View File

@ -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
})
}
}