Skip to content

Commit

Permalink
Update tests for content blocks in template parts
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan committed Dec 9, 2024
1 parent bc3c234 commit 7087a03
Showing 1 changed file with 60 additions and 4 deletions.
64 changes: 60 additions & 4 deletions packages/block-editor/src/store/test/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4029,6 +4029,47 @@ describe( 'state', () => {
},
],
},
{
type: 'SET_HAS_CONTROLLED_INNER_BLOCKS',
clientId: 'header',
hasControlledInnerBlocks: true,
},
{
type: 'REPLACE_INNER_BLOCKS',
rootClientId: 'header',
blocks: [
{
name: 'core/group',
clientId: 'header-group',
attributes: {},
innerBlocks: [
{
name: 'core/paragraph',
clientId: 'header-paragraph',
attributes: {},
innerBlocks: [],
},
],
},
],
},
{
type: 'SET_HAS_CONTROLLED_INNER_BLOCKS',
clientId: 'footer',
hasControlledInnerBlocks: true,
},
{
type: 'REPLACE_INNER_BLOCKS',
rootClientId: 'footer',
blocks: [
{
name: 'core/paragraph',
clientId: 'footer-paragraph',
attributes: {},
innerBlocks: [],
},
],
},
],
testReducer
);
Expand All @@ -4044,7 +4085,10 @@ describe( 'state', () => {
Object.entries( {
'': 'disabled',
header: 'contentOnly', // Template part.
'header-group': 'disabled', // Content block in template part.
'header-paragraph': 'contentOnly', // Content block in template part.
footer: 'contentOnly', // Template part.
'footer-paragraph': 'contentOnly', // Content block in template part.
'section-root': 'contentOnly', // Section root.
'group-1': 'contentOnly', // Section block.
'paragraph-1': 'contentOnly', // Content block in section.
Expand All @@ -4071,8 +4115,11 @@ describe( 'state', () => {
new Map(
Object.entries( {
'': 'disabled',
header: 'contentOnly',
footer: 'contentOnly',
header: 'contentOnly', // Template part.
'header-group': 'disabled', // Content block in template part.
'header-paragraph': 'contentOnly', // Content block in template part.
footer: 'contentOnly', // Template part.
'footer-paragraph': 'contentOnly', // Content block in template part.
'section-root': 'contentOnly',
'group-1': 'contentOnly',
'paragraph-1': 'contentOnly',
Expand Down Expand Up @@ -4119,7 +4166,10 @@ describe( 'state', () => {
Object.entries( {
'': 'disabled', // Section root.
header: 'contentOnly', // Template part.
'header-group': 'disabled', // Content block in template part.
'header-paragraph': 'contentOnly', // Content block in template part.
footer: 'contentOnly', // Template part.
'footer-paragraph': 'contentOnly', // Content block in template part.
'section-root': 'contentOnly', // Section root.
'group-1': 'contentOnly', // Section block.
'paragraph-1': 'contentOnly', // Content block in section.
Expand Down Expand Up @@ -4151,7 +4201,10 @@ describe( 'state', () => {
Object.entries( {
'': 'disabled', // Section root.
header: 'contentOnly', // Template part.
'header-group': 'disabled', // Content block in template part.
'header-paragraph': 'contentOnly', // Content block in template part.
footer: 'contentOnly', // Template part.
'footer-paragraph': 'contentOnly', // Content block in template part.
'section-root': 'contentOnly', // Section root.
'group-1': 'contentOnly', // Section block.
'paragraph-1': 'contentOnly', // Content block in section.
Expand Down Expand Up @@ -4180,8 +4233,11 @@ describe( 'state', () => {
new Map(
Object.entries( {
'': 'disabled',
header: 'contentOnly',
footer: 'contentOnly',
header: 'contentOnly', // Template part.
'header-group': 'disabled', // Content block in template part.
'header-paragraph': 'contentOnly', // Content block in template part.
footer: 'contentOnly', // Template part.
'footer-paragraph': 'contentOnly', // Content block in template part.
'section-root': 'disabled',
'group-1': 'contentOnly', // New section root.
'paragraph-1': 'contentOnly', // Section and content block
Expand Down

0 comments on commit 7087a03

Please sign in to comment.