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
@@ -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