feat(indicadores): CaMa follow-up tab drawn from the announced filters and columns
The tab asks GET /cama/seguimiento when it is first opened and draws the form, the table, the details and the pagination from what the answer announces, so a later change of source behind the endpoint needs no change here. It shows the demonstration notice when the answer is simulated, a clear pending state while the endpoint is not published (404 on the first page), and error, empty and retry states. Stale requests are cancelled. The sections, CaCu and initial-integration specs now expect the CaMa request when the tab opens.
This commit is contained in:
@@ -53,8 +53,9 @@ describe('Secciones compartidas por dominio', () => {
|
||||
// By id, since CaMa has one more tab.
|
||||
const pestana = (id: string) => tabs.find(t => t.id === 'tab-' + id)!;
|
||||
pestana('seguimiento').click(); harness.detectChanges();
|
||||
if (domain === 'cacu') {
|
||||
http.expectOne(r => r.url === '/cacu/seguimiento').flush({}, { status: 404, statusText: 'Pending' });
|
||||
// CaCu and CaMa request their own follow-up when the tab opens; the lab WebApi has neither yet (404).
|
||||
if (domain !== 'tea') {
|
||||
http.expectOne(r => r.url === '/' + domain + '/seguimiento').flush({}, { status: 404, statusText: 'Pending' });
|
||||
harness.detectChanges();
|
||||
}
|
||||
const tracking = root.querySelector<HTMLElement>('#panel-seguimiento')!;
|
||||
@@ -63,6 +64,12 @@ describe('Secciones compartidas por dominio', () => {
|
||||
if (domain === 'cacu') {
|
||||
expect(tracking.querySelector('tbody')).toBeNull();
|
||||
expect(tracking.querySelector('input[type=date]')).not.toBeNull();
|
||||
} else if (domain === 'cama') {
|
||||
// Pending integration: the form is gone with no table, and the retry is offered.
|
||||
expect(tracking.textContent).toContain('Funcionalidad pendiente de publicación');
|
||||
expect(tracking.querySelector('table')).toBeNull();
|
||||
expect(tracking.querySelector('app-seguimiento-tabla')).not.toBeNull();
|
||||
expect(Array.from(tracking.querySelectorAll('button')).map(b => b.textContent?.trim())).toContain('Reintentar seguimiento');
|
||||
} else {
|
||||
expect(tracking.querySelectorAll('thead th')).toHaveLength(6);
|
||||
expect(tracking.querySelectorAll('tbody tr')).toHaveLength(1);
|
||||
|
||||
Reference in New Issue
Block a user