refactor: unify CHRNX character stages
This commit is contained in:
9 files changed
+345
-61
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,
|
||||
@@ -241,3 +241,33 @@ 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/ );
|
||||
} );
|
||||
Reference in new issue
Block a user