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

+24 -9
View File
@@ -96,9 +96,16 @@ test( 'long, incomplete, empty, and missing states stay usable', async ( { page
} ),
).toBeVisible();
await expect( page.locator( '.chrnx-podcast-meta' ) ).toHaveCount( 0 );
await expect( page.locator( '.taxonomy-chrnx_topic, .taxonomy-chrnx_language' ) ).toHaveCount(
0,
);
await expect( page.getByText( 'Estado de prueba para un episodio sin show' ) ).toHaveCount( 0 );
await page.goto( '/emotion-is-not-a-slider-designing-expressive-systems-that-can-hesitate/' );
await expect( page.locator( 'pre code' ) ).toContainText( 'const state' );
await expect( page.locator( 'pre code' ) ).toContainText(
'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
);
await expectNoHorizontalOverflow( page );
for ( const [ path, title ] of [
@@ -110,9 +117,6 @@ test( 'long, incomplete, empty, and missing states stay usable', async ( { page
'/una-cuerda-rota-tambien-puede-decidir-el-arreglo/',
'Una cuerda rota también puede decidir el arreglo',
],
[ '/nota-local-sin-extracto/', 'Nota local sin extracto' ],
[ '/note-without-topic/', 'Note without a topic' ],
[ '/nota-sin-idioma-asignado/', 'Nota sin idioma asignado' ],
] ) {
await page.goto( path );
await expect( page.getByRole( 'heading', { level: 1 } ) ).toContainText( title );
@@ -120,12 +124,6 @@ test( 'long, incomplete, empty, and missing states stay usable', async ( { page
}
await expect( page.locator( '.chrnx-entry__meta a', { hasText: 'English' } ) ).toHaveCount( 0 );
await page.goto( '/unbroken-token-overflow-test/' );
await expect( page.locator( 'pre code' ) ).toContainText(
'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
);
await expectNoHorizontalOverflow( page );
await page.goto( '/journal/?chrnx_topic=..%2F..%2Fcode&chrnx_language%5B%5D=en&s%5B%5D=x' );
await expect( page.locator( 'select[name="chrnx_topic"]' ) ).toHaveValue( '' );
await expect( page.locator( 'select[name="chrnx_language"]' ) ).toHaveValue( '' );
@@ -232,6 +230,23 @@ test( 'site routes preserve heading order, named landmarks, and skip-link keyboa
}
} );
test( 'search and not-found recovery navigation landmarks have unique names', async ( {
page,
} ) => {
for ( const [ path, expected ] of [
[ '/?s=fixture-that-cannot-exist', 'Search recovery navigation' ],
[ '/this-route-does-not-exist/', 'Page not found recovery navigation' ],
] ) {
await page.goto( path );
await expect( page.getByRole( 'navigation', { name: expected } ) ).toHaveCount( 1 );
const names = await page
.locator( 'nav' )
.evaluateAll( ( nodes ) => nodes.map( ( node ) => node.getAttribute( 'aria-label' ) ) );
expect( names.every( Boolean ) ).toBeTruthy();
expect( new Set( names ).size ).toBe( names.length );
}
} );
test( 'reduced motion removes card transitions while theme preference remains user-controlled', async ( {
page,
} ) => {
+4 -43
View File
@@ -3,10 +3,11 @@
"fixtureKey": "post-code-primary",
"title": "Emotion is not a slider: designing expressive systems that can hesitate",
"excerpt": "A working note on modeling emotional state without flattening behavior into a single number.",
"content": "<!-- wp:paragraph --><p>Expressive software gets interesting when uncertainty is part of the model instead of an error to erase.</p><!-- /wp:paragraph --><!-- wp:code --><pre class=\"wp-block-code\"><code>const state = observe(world);\nconst choice = agent.respond(state, { uncertainty: true });</code></pre><!-- /wp:code -->",
"content": "<!-- wp:paragraph --><p>Expressive software gets interesting when uncertainty is part of the model instead of an error to erase.</p><!-- /wp:paragraph --><!-- wp:code --><pre class=\"wp-block-code\"><code>const state = observe(world);\nconst choice = agent.respond(state, { uncertainty: true });\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789</code></pre><!-- /wp:code -->",
"topic": "code",
"language": "en",
"featured": true
"featured": true,
"fixtureState": "unbroken-code"
},
{
"fixtureKey": "post-research-primary",
@@ -61,11 +62,8 @@
{
"fixtureKey": "post-podcast-missing-meta",
"title": "Conversación pendiente de datos editoriales",
"excerpt": "Estado de prueba para un episodio sin show ni duración asignados.",
"content": "<!-- wp:paragraph --><p>El tema debe seguir siendo claro aunque la ficha editorial todavía esté incompleta.</p><!-- /wp:paragraph -->",
"topic": "podcasts",
"language": "es",
"fixtureState": "missing-podcast-meta"
"fixtureStates": [ "missing-podcast-meta", "missing-excerpt", "missing-topic", "missing-language" ]
},
{
"fixtureKey": "post-life-fatherhood",
@@ -106,42 +104,5 @@
"content": "<!-- wp:quote --><blockquote class=\"wp-block-quote\"><p>La tinta sabía algo que el narrador todavía no.</p></blockquote><!-- /wp:quote -->",
"topic": "literature",
"language": "es"
},
{
"fixtureKey": "post-missing-excerpt",
"slug": "nota-local-sin-extracto",
"title": "Nota local sin extracto",
"content": "<!-- wp:paragraph --><p>Fixture local para comprobar el resumen ausente.</p><!-- /wp:paragraph -->",
"topic": "life",
"language": "es",
"fixtureState": "missing-excerpt"
},
{
"fixtureKey": "post-missing-topic",
"slug": "note-without-topic",
"title": "Note without a topic",
"excerpt": "A local fixture with no editorial topic.",
"content": "<!-- wp:paragraph --><p>The theme must not infer a private identity or category.</p><!-- /wp:paragraph -->",
"language": "en",
"fixtureState": "missing-topic"
},
{
"fixtureKey": "post-missing-language",
"slug": "nota-sin-idioma-asignado",
"title": "Nota sin idioma asignado",
"excerpt": "Fixture local sin taxonomía de idioma.",
"content": "<!-- wp:paragraph --><p>El contenido permanece legible sin inventar metadatos.</p><!-- /wp:paragraph -->",
"topic": "research",
"fixtureState": "missing-language"
},
{
"fixtureKey": "post-unbroken-code",
"slug": "unbroken-token-overflow-test",
"title": "Unbroken token overflow test",
"excerpt": "A deliberately hostile local layout fixture.",
"content": "<!-- wp:code --><pre class=\"wp-block-code\"><code>ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789</code></pre><!-- /wp:code -->",
"topic": "code",
"language": "en",
"fixtureState": "unbroken-code"
}
]
+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' );