Skip to content

Commit

Permalink
fixing storybook tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Sep 6, 2023
1 parent bb9f463 commit d519684
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
}
}

Expand Down

0 comments on commit d519684

Please sign in to comment.