test: cover the new content models and stop duplicate terms
Seeding guarded with term_exists(), which reads a cache that is not always warm during activation and let a second activation insert gaming-2, literature-2 and silicon-ranch-2. It asks the taxonomy directly now, by slug and by name. Fixtures gain projects and tracks, and the suites follow the assets to their generated derivatives. Also widens the Site Editor poll, which threw instead of retrying while the editor was still booting. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
7 files changed
+125
-30
No files matched your search
@@ -42,4 +42,11 @@ test( 'editorial and podcast controls initialize in the real post editor', async
|
||||
await expect( page.getByLabel( 'Duration', { exact: true } ) ).toBeVisible();
|
||||
await expect( page.getByLabel( 'Participants (one per line)', { exact: true } ) ).toBeVisible();
|
||||
await expect( page.getByLabel( 'Canonical episode URL', { exact: true } ) ).toBeVisible();
|
||||
|
||||
// Switching topic swaps which per-topic panel is offered.
|
||||
await openPanel( 'Topic' );
|
||||
await page.getByRole( 'radio', { name: 'Projects', exact: true } ).check();
|
||||
await expect( page.getByLabel( 'Episode number', { exact: true } ) ).toBeHidden();
|
||||
await openPanel( 'Project' );
|
||||
await expect( page.getByLabel( 'Show in Selected work', { exact: true } ) ).toBeVisible();
|
||||
} );
|
||||
@@ -7,7 +7,7 @@ const landings = [
|
||||
path: '/music/',
|
||||
root: '.chrnx-music-landing',
|
||||
atmosphere: '.chrnx-character-stage__collage',
|
||||
art: 'img[src*="the-no-names-musician-cutout.png"]',
|
||||
art: 'img[src*="the-no-names-musician-cutout-768.webp"]',
|
||||
internalHeadings: ':scope > h3, .chrnx-release-card h4',
|
||||
internalHeadingCount: 4,
|
||||
next: ':scope > p',
|
||||
@@ -17,7 +17,7 @@ const landings = [
|
||||
path: '/podcasts/',
|
||||
root: '.chrnx-podcast-landing',
|
||||
atmosphere: '.chrnx-character-stage__frequency',
|
||||
art: 'img[src*="alter-ego-podcasts.png"]',
|
||||
art: 'img[src*="alter-ego-podcasts-768.webp"]',
|
||||
internalHeadings: '.chrnx-podcast-card__title',
|
||||
internalHeadingCount: 1,
|
||||
next: ':scope > .wp-block-chrnx-latest-podcast',
|
||||
@@ -550,24 +550,26 @@ const immutableSurfaces = [
|
||||
name: 'Projects',
|
||||
path: '/projects/',
|
||||
root: '.chrnx-home-projects',
|
||||
art: 'img[src*="alter-ego-code.png"]',
|
||||
atmosphereCount: 1,
|
||||
imageSources: [ 'alter-ego-research.png', 'alter-ego-code.png' ],
|
||||
headings: [ 'Selected work', 'Expressive Tea', 'Ailed', 'Published research' ],
|
||||
art: 'img[src*="alter-ego-code-768.webp"]',
|
||||
atmosphereCount: 2,
|
||||
imageSources: [
|
||||
'projects-grunge-1536.webp',
|
||||
'alter-ego-research-768.webp',
|
||||
'alter-ego-code-768.webp',
|
||||
],
|
||||
// Project names come from chrnx/selected-work: picked projects newest-first,
|
||||
// then the most recent ones. This is the seeded order, not a frozen string.
|
||||
headings: [ 'Selected work', 'Ailed', 'Expressive Tea', 'Published research' ],
|
||||
paragraphs: [],
|
||||
contentText: 'Selected work Expressive Tea Ailed Published research',
|
||||
contentText: 'Selected work Ailed Expressive Tea Published research',
|
||||
},
|
||||
{
|
||||
name: 'About',
|
||||
path: '/about/',
|
||||
root: '.chrnx-about',
|
||||
art: 'img[src*="alter-ego-life.png"]',
|
||||
atmosphereCount: 0,
|
||||
imageSources: [
|
||||
'alter-ego-life.png',
|
||||
'alter-ego-literature.png',
|
||||
'alter-ego-gaming-half-body.png',
|
||||
],
|
||||
art: 'img[src*="alter-ego-life-768.webp"]',
|
||||
atmosphereCount: 1,
|
||||
imageSources: [ 'about-grunge-1536.webp', 'alter-ego-life-768.webp' ],
|
||||
headings: [ 'About', 'Beyond the work' ],
|
||||
paragraphs: [
|
||||
'I work as Lead Developer @Expressive Tea, building full-stack software with JavaScript and Python. I am also an independent researcher exploring emotion modeling and game AI; my practice includes open source work and amateur data science.',
|
||||
|
||||
@@ -6,8 +6,8 @@ const patterns = [
|
||||
patternTitle: 'Music landing',
|
||||
pageSlug: 'music',
|
||||
patternSlug: 'chrnx/music-landing',
|
||||
atmosphereAsset: 'the-no-names-collage.jpeg',
|
||||
artAsset: 'the-no-names-musician-cutout.png',
|
||||
atmosphereAsset: 'the-no-names-collage-768.webp',
|
||||
artAsset: 'the-no-names-musician-cutout-768.webp',
|
||||
contentCopy: 'The No Names es una banda activa',
|
||||
supportingCopy: 'El proceso usa generative AI',
|
||||
},
|
||||
@@ -16,8 +16,8 @@ const patterns = [
|
||||
patternTitle: 'Podcast landing',
|
||||
pageSlug: 'podcasts',
|
||||
patternSlug: 'chrnx/podcast-landing',
|
||||
atmosphereAsset: 'podcast-frequency-grunge.png',
|
||||
artAsset: 'alter-ego-podcasts.png',
|
||||
atmosphereAsset: 'podcast-frequency-grunge-1536.webp',
|
||||
artAsset: 'alter-ego-podcasts-768.webp',
|
||||
contentCopy: 'Conversations about the work behind software, research, music, and games.',
|
||||
supportingCopy: '<!-- wp:chrnx/latest-podcast /-->',
|
||||
},
|
||||
@@ -55,12 +55,15 @@ async function closeWelcomeGuide( page ) {
|
||||
}
|
||||
|
||||
async function waitForEditor( page ) {
|
||||
// The Site Editor boots slower than the default 5s poll under load.
|
||||
await expect
|
||||
.poll( () =>
|
||||
page.evaluate( () => {
|
||||
const editor = window.wp?.data?.select( 'core/block-editor' );
|
||||
return typeof editor?.getBlocks === 'function' && editor.getBlocks().length > 0;
|
||||
} ),
|
||||
.poll(
|
||||
() =>
|
||||
page.evaluate( () => {
|
||||
const editor = window.wp?.data?.select( 'core/block-editor' );
|
||||
return typeof editor?.getBlocks === 'function' && editor.getBlocks().length > 0;
|
||||
} ),
|
||||
{ timeout: 20_000 },
|
||||
)
|
||||
.toBe( true );
|
||||
}
|
||||
@@ -70,7 +73,12 @@ async function waitForPatternEditorState( page ) {
|
||||
.poll(
|
||||
() =>
|
||||
page.evaluate( () => {
|
||||
const store = window.wp.data.select( 'core/block-editor' );
|
||||
// The editor may still be booting on the first poll; returning an
|
||||
// empty list retries instead of throwing out of expect.poll.
|
||||
const store = window.wp?.data?.select( 'core/block-editor' );
|
||||
if ( typeof store?.getBlocks !== 'function' ) {
|
||||
return [];
|
||||
}
|
||||
const flatten = ( blocks ) =>
|
||||
blocks.flatMap( ( block ) => [ block, ...flatten( block.innerBlocks || [] ) ] );
|
||||
const all = flatten( store.getBlocks() );
|
||||
|
||||
Reference in new issue
Block a user