fix: finalize CHRNX fixture and landmark contracts

This commit is contained in:
chrnx committed 2026-08-12 09:11:52 -05:00
1 parent 1e9386ac13
commit d575e1ffad
6 files changed
+77 -65

No files matched your search

+16 -6
View File
@@ -16,17 +16,18 @@ test( 'local visual fixtures define stable pages and representative editorial st
[ 'home', 'journal', 'projects', 'music', 'podcasts', 'about', 'subscribe' ],
);
assert.ok( pages.every( ( page ) => page.fixtureKey && page.status === 'publish' ) );
assert.ok( posts.length >= 10 );
assert.equal( posts.length, 12 );
assert.ok( posts.some( ( post ) => post.title.length > 100 ) );
assert.ok( posts.some( ( post ) => post.content.includes( 'wp:code' ) ) );
assert.ok( posts.some( ( post ) => post.fixtureState === 'missing-media' ) );
assert.ok( posts.some( ( post ) => post.fixtureState === 'missing-podcast-meta' ) );
assert.ok( posts.some( ( post ) => post.fixtureState === 'missing-excerpt' && !( 'excerpt' in post ) ) );
assert.ok( posts.some( ( post ) => post.fixtureState === 'missing-topic' && !( 'topic' in post ) ) );
assert.ok( posts.some( ( post ) => post.fixtureState === 'missing-language' && !( 'language' in post ) ) );
const hasState = ( post, state ) => post.fixtureState === state || post.fixtureStates?.includes( state );
assert.ok( posts.some( ( post ) => hasState( post, 'missing-podcast-meta' ) ) );
assert.ok( posts.some( ( post ) => hasState( post, 'missing-excerpt' ) && !( 'excerpt' in post ) ) );
assert.ok( posts.some( ( post ) => hasState( post, 'missing-topic' ) && !( 'topic' in post ) ) );
assert.ok( posts.some( ( post ) => hasState( post, 'missing-language' ) && !( 'language' in post ) ) );
assert.ok( posts.some( ( post ) => post.fixtureState === 'unbroken-code' && /[A-Z0-9]{256}/.test( post.content ) ) );
assert.ok( posts.some( ( post ) => /^https:\/\//.test( post.canonicalEpisodeUrl ?? '' ) ) );
assert.ok( posts.some( ( post ) => post.fixtureState === 'missing-podcast-meta' && !( 'canonicalEpisodeUrl' in post ) ) );
assert.ok( posts.some( ( post ) => hasState( post, 'missing-podcast-meta' ) && !( 'canonicalEpisodeUrl' in post ) ) );
assert.equal( new Set( posts.map( ( post ) => post.fixtureKey ) ).size, posts.length );
for ( const topic of [ 'code', 'research', 'gaming', 'literature', 'music', 'podcasts', 'life' ] ) {
assert.ok( posts.some( ( post ) => post.topic === topic ), `missing ${ topic } fixture` );
@@ -42,12 +43,21 @@ test( 'the seed entrypoint is explicitly local-only and uses a stable fixture ke
assert.match( shell, /featured-1/ );
assert.match( shell, /subscribe-unavailable/ );
assert.match( php, /_chrnx_fixture_key/ );
assert.match( php, /wp_delete_post/ );
assert.match( php, /canonical_episode_url/ );
assert.match( php, /show_on_front/ );
assert.match( php, /page_on_front/ );
assert.match( php, /page_for_posts/ );
} );
test( 'search and not-found recovery landmarks declare distinct accessible names', () => {
const search = read( 'templates/search.html' );
const missing = read( 'templates/404.html' );
assert.match( search, /"ariaLabel":"Search recovery navigation"/ );
assert.match( missing, /"ariaLabel":"Page not found recovery navigation"/ );
assert.notEqual( search.match( /"ariaLabel":"([^"]+)"/ )?.[ 1 ], missing.match( /"ariaLabel":"([^"]+)"/ )?.[ 1 ] );
} );
test( 'the visual layer is separately enqueued and covers responsive accessible states', () => {
const assets = read( 'inc/assets.php' );
const components = read( 'assets/css/components.css' );