feat(ui): incorporar base institucional UX-06B
This commit is contained in:
@@ -1,12 +1,36 @@
|
||||
:host { display: block; }
|
||||
.dashboard { max-width: 1440px; margin: 0 auto; }
|
||||
h1 { font: var(--mat-sys-headline-large); margin: .65rem 0; }
|
||||
h1 { font: var(--mat-sys-headline-large); font-family: var(--issste-font-heading); font-weight: 700; margin: .65rem 0; }
|
||||
header p { color: var(--mat-sys-on-surface-variant); margin-bottom: 1.5rem; }
|
||||
.domain { color: var(--mat-sys-primary); font: var(--mat-sys-label-large); }
|
||||
.notice { padding: 1rem 1.25rem; border-left: 4px solid var(--mat-sys-primary); background: var(--mat-sys-surface-container); border-radius: 8px; }
|
||||
.state { padding: 1.25rem; margin: 0; }
|
||||
mat-form-field { width: 100%; max-width: 24rem; }
|
||||
@media (max-width: 550px) { h1 { font: var(--mat-sys-headline-medium); } }
|
||||
@media (max-width: 550px) { h1 { font-size: var(--mat-sys-headline-medium-size); line-height: var(--mat-sys-headline-medium-line-height); } }
|
||||
.catalog-search { display: flex; align-items: flex-start; gap: .75rem; flex-wrap: wrap; }
|
||||
.catalog-search button { margin-top: .5rem; }
|
||||
.search-result { color: var(--mat-sys-on-surface-variant); font: var(--mat-sys-body-medium); }
|
||||
|
||||
nav {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--issste-space-2);
|
||||
padding: var(--issste-space-2);
|
||||
background: var(--issste-surface);
|
||||
border: 1px solid var(--issste-border);
|
||||
border-radius: var(--issste-radius);
|
||||
}
|
||||
|
||||
nav a {
|
||||
flex: 1 1 4rem;
|
||||
max-width: 10rem;
|
||||
color: var(--issste-text);
|
||||
border-radius: var(--issste-radius);
|
||||
}
|
||||
|
||||
nav a[aria-current='page'] {
|
||||
background: var(--issste-accent);
|
||||
font-weight: 700;
|
||||
text-decoration: underline;
|
||||
text-underline-offset: .25em;
|
||||
}
|
||||
|
||||
@@ -41,6 +41,35 @@ describe('UX-05B catálogo expandible', () => {
|
||||
function flushAll() { http.match(r => r.url.includes('/figuras/')).forEach(r => r.flush({ data: [{ y: [0, null] }], layout: {} })); fixture.detectChanges(); }
|
||||
function control(index = 0) { return fixture.debugElement.queryAll(By.directive(IndicadorPeriodFilters))[index].componentInstance as IndicadorPeriodFilters; }
|
||||
|
||||
it('UX-06B conserva una navegación con rutas y estado activo en los tres dominios', () => {
|
||||
const domains = ['tea', 'cacu', 'cama'] as const;
|
||||
for (const domain of domains) {
|
||||
if (domain !== 'tea') page.changeDominio(domain);
|
||||
load([], domain);
|
||||
const navs = fixture.nativeElement.querySelectorAll('nav') as NodeListOf<HTMLElement>;
|
||||
expect(navs).toHaveLength(1);
|
||||
expect(navs[0].getAttribute('aria-label')).toBe('Dominios de indicadores');
|
||||
const links = Array.from(navs[0].querySelectorAll('a'));
|
||||
expect(links.map(link => link.textContent?.trim())).toEqual(['TEA', 'CaCu', 'CaMa']);
|
||||
expect(links.map(link => link.getAttribute('href'))).toEqual(domains.map(d => '/indicadores/' + d));
|
||||
expect(links.filter(link => link.getAttribute('aria-current') === 'page')).toHaveLength(1);
|
||||
expect(links[domains.indexOf(domain)].getAttribute('aria-current')).toBe('page');
|
||||
expect(cards()).toHaveLength(0);
|
||||
http.expectNone(() => true);
|
||||
}
|
||||
});
|
||||
|
||||
it('UX-06B conserva el selector técnico claro/oscuro y no vuelve a cargar el catálogo', async () => {
|
||||
load();
|
||||
await fixture.whenStable(); fixture.detectChanges();
|
||||
const select = fixture.debugElement.query(By.directive(MatSelect)).componentInstance as MatSelect;
|
||||
expect(select.options.map(option => option.value)).toEqual(['claro', 'oscuro']);
|
||||
expect(select.value).toBe('claro');
|
||||
page.changeTema('oscuro'); fixture.detectChanges();
|
||||
expect(page.tema).toBe('oscuro');
|
||||
expect(cards().every(card => !card.expanded)).toBe(true);
|
||||
http.expectNone(() => true);
|
||||
});
|
||||
it.each([0, 2, 18, 37])('catálogo de %i conserva orden y no consulta figuras inicialmente', count => {
|
||||
const items = Array.from({ length: count }, (_, i) => ({ ...item, id: 'id-' + i }));
|
||||
load(items);
|
||||
|
||||
Reference in New Issue
Block a user