add bitacora page, self-hosted fonts/icons, review fixes for the install package

This commit is contained in:
Roberto Treviño Cervantes
2026-10-30 11:19:34 -06:00
parent 8c63ed83ac
commit f4d2a3e85f
39 changed files with 275 additions and 721 deletions
+26 -6
View File
@@ -1,14 +1,14 @@
import { provideHttpClient } from '@angular/common/http';
import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing';
import { TestBed } from '@angular/core/testing';
import { ReportesPage } from './reportes-page';
import { ReportsPage } from './reportes-page';
describe('ReportesPage', () => {
describe('ReportsPage', () => {
let http: HttpTestingController;
beforeEach(() => {
TestBed.configureTestingModule({
imports: [ReportesPage],
imports: [ReportsPage],
providers: [provideHttpClient(), provideHttpClientTesting()],
});
http = TestBed.inject(HttpTestingController);
@@ -17,7 +17,7 @@ describe('ReportesPage', () => {
afterEach(() => http.verify());
it('shows the indicator status and the aggregate attempts', () => {
const fixture = TestBed.createComponent(ReportesPage);
const fixture = TestBed.createComponent(ReportsPage);
fixture.detectChanges();
http.expectOne('/reportes/indicadores').flush({
cacu: { estado: 'ok', pendiente: false, fin: '2026-10-29T10:00:00+00:00', duracion_s: 12 },
@@ -48,9 +48,29 @@ describe('ReportesPage', () => {
expect(fixture.nativeElement.querySelector('.campos').textContent).toContain('out_of_catalog: 2');
});
it('keeps polling after a failed request', () => {
vi.useFakeTimers();
try {
const fixture = TestBed.createComponent(ReportsPage);
fixture.detectChanges();
http.expectOne('/reportes/indicadores').flush('caída', { status: 502, statusText: 'Bad Gateway' });
http.expectOne((r) => r.url === '/reportes/importaciones');
expect(fixture.componentInstance.error()).toBeTruthy();
vi.advanceTimersByTime(15000);
http.expectOne('/reportes/indicadores').flush({ cacu: { estado: 'ok', pendiente: false } });
http.expectOne((r) => r.url === '/reportes/importaciones').flush({ resumen: { intentos: {}, ultimo: null }, intentos: [] });
expect(fixture.componentInstance.error()).toBeNull();
expect(fixture.componentInstance.statuses()?.cacu.estado).toBe('ok');
fixture.destroy();
} finally {
vi.useRealTimers();
}
});
it('asks for a recomputation', () => {
const fixture = TestBed.createComponent(ReportesPage);
fixture.componentInstance.recalcular('tea');
const fixture = TestBed.createComponent(ReportsPage);
fixture.componentInstance.recompute('tea');
http.expectOne('/reportes/indicadores/tea/recalcular').flush({ pendiente: true });
});
});