-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Post Comments Form: Add "proper" visual representation in the editor (#…
…40368) Co-authored-by: Bruno Ribarić <43731400+ribaricplusplus@users.noreply.github.com> Co-authored-by: Michael Burridge <mburridge@users.noreply.github.com> Co-authored-by: David Arenas <david.arenas@automattic.com> Co-authored-by: Bernie Reiter <ockham@raz.or.at>
- Loading branch information
1 parent
0bb230c
commit 08d34f3
Showing
5 changed files
with
90 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.wp-block-post-comments-form * { | ||
pointer-events: none; | ||
} |
46 changes: 46 additions & 0 deletions
46
packages/e2e-tests/specs/experiments/blocks/post-comments-form.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { | ||
insertBlock, | ||
activateTheme, | ||
setOption, | ||
visitSiteEditor, | ||
openSiteEditorNavigationPanel, | ||
navigateSiteEditorBackToRoot, | ||
deleteAllTemplates, | ||
canvas, | ||
} from '@wordpress/e2e-test-utils'; | ||
|
||
describe( 'Post Comments Form', () => { | ||
beforeAll( async () => { | ||
await activateTheme( 'emptytheme' ); | ||
await deleteAllTemplates( 'wp_template' ); | ||
} ); | ||
|
||
describe( 'placeholder', () => { | ||
it( 'displays in site editor even when comments are closed by default', async () => { | ||
await setOption( 'default_comment_status', 'closed' ); | ||
|
||
// Navigate to "Singular" post template | ||
await visitSiteEditor(); | ||
await openSiteEditorNavigationPanel(); | ||
await navigateSiteEditorBackToRoot(); | ||
await expect( page ).toClick( | ||
'.components-navigation__item-title', | ||
{ text: /templates/i } | ||
); | ||
await expect( page ).toClick( '.components-heading > a', { | ||
text: /singular/i, | ||
} ); | ||
|
||
// Insert post comments form | ||
await insertBlock( 'Post Comments Form' ); | ||
|
||
// Ensure the placeholder is there | ||
await expect( canvas() ).toMatchElement( | ||
'.wp-block-post-comments-form .comment-form' | ||
); | ||
} ); | ||
} ); | ||
} ); |