Skip to content

Commit

Permalink
fix: cleanup and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mpgxvii committed Mar 19, 2024
1 parent 3f3592d commit 12ee55b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ export class HealthkitConverterService extends ConverterService {
init() {}

processData(payload) {
return this.processCacheData(payload.data.answers)
}

processCacheData(answers) {
const answers = payload.data.answers
this.logger.log('Answers to process', answers)
const values = Object.entries(answers).map(([key, value]) => ({
questionId: key.toString(),
Expand Down
3 changes: 3 additions & 0 deletions src/app/core/services/kafka/schema.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { TestBed } from '@angular/core/testing'

import {
ConverterFactoryServiceMock,
KeyConverterServiceMock,
LocalizationServiceMock,
LogServiceMock,
QuestionnaireServiceMock,
Expand All @@ -20,6 +21,7 @@ import { LogService } from '../misc/log.service'
import { GlobalStorageService } from '../storage/global-storage.service'
import { ConverterFactoryService } from './converters/converter-factory.service.'
import { SchemaService } from './schema.service'
import { KeyConverterService } from './converters/key-converter.service'

describe('SchemaService', () => {
let service
Expand All @@ -34,6 +36,7 @@ describe('SchemaService', () => {
{ provide: LocalizationService, useClass: LocalizationServiceMock },
{ provide: SubjectConfigService, useClass: SubjectConfigServiceMock },
{ provide: RemoteConfigService, useClass: RemoteConfigServiceMock },
{ provide: KeyConverterService, useClass: KeyConverterServiceMock },
{
provide: ConverterFactoryService,
useClass: ConverterFactoryServiceMock
Expand Down
10 changes: 10 additions & 0 deletions src/app/shared/testing/mock-services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ export class RemoteConfigServiceMock {
return new Subject()
}
}

export class KeyConverterServiceMock {
getKafkaTopic() {
return Promise.resolve()
}
getSchemas() {
return Promise.resolve()
}
}

export class LogServiceMock {
log() {}
}
Expand Down

0 comments on commit 12ee55b

Please sign in to comment.