Merge branch 'feature/character-led-sections' into feature/music-podcast-grunge-stages
This commit is contained in:
20 files changed
+1313
-76
No files matched your search
@@ -144,7 +144,7 @@ test( 'lower home sections preserve editorial order and define layered panel tre
|
||||
}
|
||||
|
||||
assert.match( homeMusic, /chrnx_get_topic_portrait_markup\( 'music-collage'/ );
|
||||
assert.match( homeMusic, /chrnx-home-music__collage-layer/ );
|
||||
assert.match( homeMusic, /chrnx-character-stage__atmosphere/ );
|
||||
assert.doesNotMatch( components, /url\([^)]*the-no-names-collage\.jpeg/ );
|
||||
assert.match(
|
||||
components,
|
||||
@@ -181,8 +181,13 @@ test( 'all approved portraits rebuild byte-identically within payload bounds', (
|
||||
assert.deepEqual( readdirSync( external ), [ 'sentinel' ] );
|
||||
execFileSync( './scripts/build-responsive-images.sh', [ output ], { cwd: new URL( '../..', import.meta.url ) } );
|
||||
const names = readdirSync( output ).sort();
|
||||
assert.equal( names.length, 40 );
|
||||
assert.equal( names.length, 45 );
|
||||
for ( const name of [
|
||||
'alter-ego-gaming-half-body-384.avif',
|
||||
'alter-ego-gaming-half-body-384.webp',
|
||||
'alter-ego-gaming-half-body-768.avif',
|
||||
'alter-ego-gaming-half-body-768.webp',
|
||||
'alter-ego-gaming-half-body.json',
|
||||
'the-no-names-collage-384.avif',
|
||||
'the-no-names-collage-384.webp',
|
||||
'the-no-names-collage-768.avif',
|
||||
@@ -193,6 +198,7 @@ test( 'all approved portraits rebuild byte-identically within payload bounds', (
|
||||
}
|
||||
let total = 0;
|
||||
let collageTotal = 0;
|
||||
let gamingHalfBodyTotal = 0;
|
||||
for ( const name of names ) {
|
||||
const generated = readFileSync( join( output, name ) );
|
||||
const committed = readFileSync( new URL( `../../assets/images/generated/${ name }`, import.meta.url ) );
|
||||
@@ -213,10 +219,17 @@ test( 'all approved portraits rebuild byte-identically within payload bounds', (
|
||||
if ( name.startsWith( 'the-no-names-collage-' ) ) {
|
||||
collageTotal += generated.length;
|
||||
}
|
||||
if ( name.startsWith( 'alter-ego-gaming-half-body-' ) ) {
|
||||
gamingHalfBodyTotal += generated.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
assert.ok( collageTotal <= 400 * 1024, `collage derivatives exceed 400 KiB: ${ collageTotal }` );
|
||||
assert.ok( total <= 2.1 * 1024 * 1024, `derivatives exceed 2.1 MiB: ${ total }` );
|
||||
assert.ok(
|
||||
gamingHalfBodyTotal <= 340 * 1024,
|
||||
`gaming half-body derivatives exceed 340 KiB: ${ gamingHalfBodyTotal }`,
|
||||
);
|
||||
assert.ok( total <= 2.4 * 1024 * 1024, `derivatives exceed 2.4 MiB: ${ total }` );
|
||||
} finally {
|
||||
rmSync( output, { recursive: true, force: true } );
|
||||
rmSync( external, { recursive: true, force: true } );
|
||||
@@ -241,3 +254,59 @@ test( 'front page and section pages connect the real editorial patterns', () =>
|
||||
assert.match( fixtures, new RegExp( slug.replace( '/', '\\/' ) ) );
|
||||
}
|
||||
} );
|
||||
|
||||
test( 'character-led openings share the exact stage class contract', () => {
|
||||
for ( const path of [
|
||||
'patterns/home-projects.php',
|
||||
'patterns/home-music.php',
|
||||
'patterns/music-landing.php',
|
||||
'patterns/podcast-landing.php',
|
||||
'patterns/about.php',
|
||||
'blocks/topic-hero/render.php',
|
||||
] ) {
|
||||
const source = read( path );
|
||||
const stageDeclaration = path.startsWith( 'patterns/' )
|
||||
? /className":"chrnx-character-stage"/g
|
||||
: /class="chrnx-character-stage"/g;
|
||||
assert.equal( ( source.match( stageDeclaration ) || [] ).length, 1, path );
|
||||
for ( const className of [
|
||||
'chrnx-character-stage__atmosphere',
|
||||
'chrnx-character-stage__content',
|
||||
'chrnx-character-stage__art',
|
||||
] ) {
|
||||
assert.match( source, new RegExp( className ), `${ path } missing ${ className }` );
|
||||
}
|
||||
}
|
||||
|
||||
const musicLanding = read( 'patterns/music-landing.php' );
|
||||
assert.match( musicLanding, /chrnx_get_topic_portrait_markup\( 'music-collage', __\( 'The No Names collage', 'chrnx' \), 'chrnx-character-stage__collage' \)/ );
|
||||
assert.doesNotMatch( musicLanding, /<img\s+src=/ );
|
||||
assert.match( read( 'patterns/about.php' ), /chrnx-character-facets/ );
|
||||
assert.match( read( 'blocks/topic-hero/render.php' ), /chrnx-topic-hero__fallback/ );
|
||||
} );
|
||||
|
||||
test( 'character stages define the shared mockup effect and responsive geometry', () => {
|
||||
const components = read( 'assets/css/components.css' );
|
||||
const visualStates = read( 'tests/e2e/visual-states.spec.mjs' );
|
||||
|
||||
for ( const token of [
|
||||
'--chrnx-character-accent',
|
||||
'--chrnx-character-halo',
|
||||
'--chrnx-character-wash',
|
||||
'--chrnx-character-shadow',
|
||||
] ) {
|
||||
assert.match( components, new RegExp( token ), `${ token } must be shared` );
|
||||
}
|
||||
assert.match( components, /\.chrnx-character-stage\s*\{[\s\S]*?grid-template-columns:\s*minmax\(0,\s*55fr\)\s+minmax\(0,\s*45fr\)/ );
|
||||
assert.match( components, /\.chrnx-character-stage__atmosphere::before/ );
|
||||
assert.match( components, /\.chrnx-character-stage__atmosphere::after/ );
|
||||
assert.match( components, /\.chrnx-character-stage__art\s*>\s*\.chrnx-responsive-portrait/ );
|
||||
assert.match( components, /@media \(max-width:\s*780px\)[\s\S]*?\.chrnx-character-stage\s*\{[\s\S]*?grid-template-columns:\s*1fr/ );
|
||||
assert.match( components, /@media \(prefers-reduced-motion:\s*reduce\)[\s\S]*?\.chrnx-character-stage/ );
|
||||
assert.match( components, /--chrnx-character-copy-surface/ );
|
||||
assert.match( components, /\.chrnx-music-landing \.chrnx-character-stage__content\s*>\s*\.chrnx-responsive-portrait:has\(\.chrnx-character-stage__collage\)[\s\S]*?inset:\s*0/ );
|
||||
for ( const timeout of [ '180_000', '120_000', '60_000' ] ) {
|
||||
assert.match( visualStates, new RegExp( `test\\.setTimeout\\( ${ timeout } \\)` ) );
|
||||
}
|
||||
assert.match( visualStates, /character stage below-fold derivatives wait for approach/ );
|
||||
} );
|
||||
Reference in new issue
Block a user