Add TEA status measure view
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { TeaStatusPage } from './tea-status-page';
|
||||
|
||||
describe('TeaStatusPage', () => {
|
||||
it('shows the stages in a FHIR report and reports a failed query', () => {
|
||||
TestBed.configureTestingModule({ providers: [provideHttpClient(), provideHttpClientTesting()] });
|
||||
const component = TestBed.createComponent(TeaStatusPage).componentInstance;
|
||||
const http = TestBed.inject(HttpTestingController);
|
||||
component.consultar();
|
||||
const request = http.expectOne('/tea/fhir/Measure/M28_casos_por_estado/$evaluate-measure?periodo=2025-S1');
|
||||
request.flush({ group: [{ population: [{ count: 6 }], stratifier: [{ stratum: [
|
||||
{ value: { coding: [{ code: 'SOLO_MCHAT' }] }, population: [{ count: 2 }] },
|
||||
] }] }] });
|
||||
expect(component.total()).toBe(6);
|
||||
expect(component.filas()).toEqual([{ codigo: 'SOLO_MCHAT', nombre: 'M-CHAT', cantidad: 2 }]);
|
||||
component.consultar();
|
||||
http.expectOne('/tea/fhir/Measure/M28_casos_por_estado/$evaluate-measure?periodo=2025-S1')
|
||||
.flush({}, { status: 404, statusText: 'Not Found' });
|
||||
expect(component.estado()).toBe('error');
|
||||
http.verify();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user