chore(tests): retirar scripts temporales UX-06
This commit is contained in:
@@ -42,3 +42,9 @@ __screenshots__/
|
||||
# System files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Temporary UX reports and one-off static checks
|
||||
/UX-*-informe.md
|
||||
/scripts/ux06b-resources.test.mjs
|
||||
/scripts/ux06c-presentation.test.mjs
|
||||
/scripts/ux06d-presentation.test.mjs
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
|
||||
const root = new URL('../', import.meta.url);
|
||||
const read = path => readFileSync(new URL(path, root), 'utf8');
|
||||
|
||||
test('UX-06B: idioma, título, base y favicon', () => {
|
||||
const index = read('src/index.html');
|
||||
for (const value of [
|
||||
'lang="es"',
|
||||
'<title>Plataforma de Indicadores | ISSSTELEON</title>',
|
||||
'<base href="/"',
|
||||
'href="favicon.ico"',
|
||||
]) assert.ok(index.includes(value), value);
|
||||
});
|
||||
|
||||
test('UX-06B: fuentes aprobadas, pesos, HTTPS, swap y fallback', () => {
|
||||
const index = read('src/index.html');
|
||||
assert.equal(index.match(/family=Rajdhani/g)?.length, 1);
|
||||
assert.equal(index.match(/family=Roboto/g)?.length, 1);
|
||||
for (const value of [
|
||||
'https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700',
|
||||
'family=Roboto:wght@300;400;500',
|
||||
'display=swap',
|
||||
'https://fonts.googleapis.com/icon?family=Material+Icons',
|
||||
]) assert.ok(index.includes(value), value);
|
||||
const styles = read('src/styles.scss');
|
||||
assert.ok(styles.includes("--issste-font-heading: 'Rajdhani', 'Roboto', sans-serif;"));
|
||||
assert.ok(styles.includes("--issste-font-body: 'Roboto', sans-serif;"));
|
||||
});
|
||||
|
||||
test('UX-06B: PNG original y mecanismo de publicación del asset', () => {
|
||||
const png = readFileSync(new URL('public/images/LogoISSSTELEON.png', root));
|
||||
assert.deepEqual(Array.from(png.subarray(0, 8)), [137, 80, 78, 71, 13, 10, 26, 10]);
|
||||
assert.equal(png.readUInt32BE(16), 1125);
|
||||
assert.equal(png.readUInt32BE(20), 358);
|
||||
const config = JSON.parse(read('angular.json'));
|
||||
assert.ok(config.projects.WebApp.architect.build.options.assets.some(
|
||||
asset => asset.glob === '**/*' && asset.input === 'public',
|
||||
));
|
||||
assert.ok(read('src/app/app.html').includes('src="images/LogoISSSTELEON.png"'));
|
||||
});
|
||||
|
||||
test('UX-06B: tokens globales, tema único y uso en shell/navegación', () => {
|
||||
const styles = read('src/styles.scss');
|
||||
for (const value of [
|
||||
'--issste-text: #081839;',
|
||||
'--issste-background: #F7F7F7;',
|
||||
'@include mat.theme-overrides(',
|
||||
'primary: var(--issste-text)',
|
||||
'outline: var(--issste-text-secondary)',
|
||||
]) assert.ok(styles.includes(value), value);
|
||||
assert.equal(styles.match(/@include mat.theme\(/g)?.length, 1);
|
||||
assert.ok(read('src/app/app.scss').includes('background: var(--issste-surface)'));
|
||||
assert.ok(read('src/app/app.scss').includes('font-family: var(--issste-font-heading)'));
|
||||
assert.ok(read('src/app/features/indicadores/indicadores-page.scss')
|
||||
.includes('background: var(--issste-accent)'));
|
||||
});
|
||||
@@ -1,39 +0,0 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
|
||||
const root = new URL('../src/app/features/indicadores/', import.meta.url);
|
||||
const read = path => readFileSync(new URL(path, root), 'utf8');
|
||||
|
||||
test('UX-06C: geometría prevista conserva título flexible, flecha lateral y foco visible', () => {
|
||||
const card = read('indicador-catalog-card.ts');
|
||||
const styles = card.slice(card.indexOf(' styles:'), card.indexOf('export class'));
|
||||
assert.match(styles, /grid-template-columns:\s*minmax\(0, 1fr\) auto/);
|
||||
assert.match(styles, /header button\s*\{[^}]*justify-self:\s*end/);
|
||||
assert.match(styles, /header button\s*\{[^}]*min-width:\s*48px;\s*min-height:\s*48px/);
|
||||
assert.match(styles, /button:focus-visible\s*\{[^}]*outline:/);
|
||||
assert.match(styles, /overflow-wrap:\s*anywhere/);
|
||||
});
|
||||
|
||||
test('UX-06C: navegación centrada sin banda blanca ni sticky añadido', () => {
|
||||
const styles = read('indicadores-page.scss');
|
||||
const nav = styles.match(/(?:^|\n)nav\s*\{([^}]*)\}/)?.[1];
|
||||
assert.ok(nav);
|
||||
assert.match(nav, /justify-content:\s*center/);
|
||||
assert.match(nav, /flex-wrap:\s*wrap/);
|
||||
assert.doesNotMatch(nav, /background|border:/);
|
||||
assert.doesNotMatch(styles, /position:\s*(sticky|fixed)/);
|
||||
assert.match(styles, /nav a\[aria-current='page'\]\s*\{[^}]*text-decoration:\s*underline/);
|
||||
});
|
||||
|
||||
test('UX-06C: filtros preparados para valores largos y apilamiento móvil con ayudas dinámicas', () => {
|
||||
const styles = read('indicador-period-filters.scss');
|
||||
const template = read('indicador-period-filters.html');
|
||||
assert.match(styles, /\.select-value\s*\{[^}]*white-space:\s*normal;[^}]*overflow-wrap:\s*anywhere/);
|
||||
assert.match(styles, /@media\s*\(max-width:\s*550px\)[\s\S]*flex:\s*1 1 100%/);
|
||||
assert.match(styles, /mat-form-field\s*\{[^}]*min-width:\s*0/);
|
||||
const fields = template.match(/<mat-form-field\b[^>]*>/g);
|
||||
assert.equal(fields.length, 5);
|
||||
assert.ok(fields.every(field => field.includes('subscriptSizing="dynamic"')));
|
||||
assert.doesNotMatch(styles, /overflow:\s*hidden|z-index|\.mat-mdc-|::ng-deep/);
|
||||
});
|
||||
Reference in New Issue
Block a user