Uh oh!
There was an error while loading. Please reload this page.
fix: when show template is enabled, insert in post content area instead - #3737
fix: when show template is enabled, insert in post content area instead#3737Arukuen wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThe Design Library button now inserts into the first ChangesDesign Library template-locked flow
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🤖 Pull request artifacts
|
Size Change: +53 B (0%) Total Size: 2.64 MB 📦 View Changed
ℹ️ View Unchanged
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
e2e/tests/design-library.spec.ts (1)
83-85: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert the insertion root.
The test verifies that the modal opens, but it does not verify that the inserted
stackable/design-libraryblock uses the firstcore/post-contentclient ID. Add this assertion so the test covers the behavior changed by this PR. The block-editor selectors expose the required client IDs and root relationship. (developer.wordpress.org)Suggested assertion
await openDesignLibrary( page ) + const { postContentClientId, designLibraryRootClientId } =+ await page.evaluate( () => {+ const blockEditor = window.wp.data.select( 'core/block-editor' )+ const [ postContentClientId ] =+ blockEditor.getBlocksByName( 'core/post-content' )+ const [ designLibraryClientId ] =+ blockEditor.getBlocksByName( 'stackable/design-library' )++ return {+ postContentClientId,+ designLibraryRootClientId:+ blockEditor.getBlockRootClientId( designLibraryClientId ),+ }+ } )+ expect( designLibraryRootClientId ).toBe( postContentClientId )+ await expect( page.locator( '.ugb-modal-design-library' ) ).toBeVisible()🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@e2e/tests/design-library.spec.ts` around lines 83 - 85, Extend the test after openDesignLibrary in design-library.spec.ts to assert that the inserted stackable/design-library block uses the first core/post-content block’s client ID as its insertion root. Use the block-editor selectors and root relationship exposed by the existing test utilities, while preserving the modal visibility assertion.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@e2e/tests/design-library.spec.ts`:
- Around line 83-85: Extend the test after openDesignLibrary in
design-library.spec.ts to assert that the inserted stackable/design-library
block uses the first core/post-content block’s client ID as its insertion root.
Use the block-editor selectors and root relationship exposed by the existing
test utilities, while preserving the modal visibility assertion.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 69cc9b63-0394-4120-9afb-61d039d2b80d
📒 Files selected for processing (2)
e2e/tests/design-library.spec.tssrc/plugins/design-library-button/design-library-button.js
fixes#3735
Summary by CodeRabbit
New Features
Tests