Skip to content

Commit 051854b

Browse files
authored
Merge pull request #591 from Automattic/fix/multiple-custom-fields
Prevent multiple custom fields from being created
2 parents bbd57a5 + 0f1abd5 commit 051854b

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

modules/editorial-comments/editorial-comments.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function add_admin_scripts( ) {
8484
if ( !in_array( $pagenow, array( 'post.php', 'page.php', 'post-new.php', 'page-new.php' ) ) )
8585
return;
8686

87-
wp_enqueue_script( 'edit_flow-post_comment', $this->module_url . 'lib/editorial-comments.js', array( 'jquery','post' ), EDIT_FLOW_VERSION, true );
87+
wp_enqueue_script( 'edit_flow-post_comment', $this->module_url . 'lib/editorial-comments.js', array( 'jquery', 'wp-ajax-response' ), EDIT_FLOW_VERSION, true );
8888
wp_localize_script( 'edit_flow-post_comment', '__ef_localize_post_comment', array(
8989
'and' => esc_html__( 'and', 'edit-flow' ),
9090
'none_notified' => esc_html__( 'No one will be notified.', 'edit-flow' ),
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* WordPress dependencies
3+
*/
4+
5+
import { createNewPost, saveDraft } from "@wordpress/e2e-test-utils";
6+
7+
describe("Editorial Comments", () => {
8+
9+
it("expects a user can create an editorial comment on a post", async () => {
10+
await createNewPost({title: 'Title'});
11+
await saveDraft();
12+
13+
// todo: Eventually, we should show the "Respond to post" button when a post is saved in Gutenberg
14+
// without having to reload the page
15+
await page.reload({ waitUntil: ["networkidle0", "domcontentloaded"] });
16+
17+
const COMMENT_TEXT = 'Hello';
18+
19+
const respondButton = await page.$('#ef-comment_respond');
20+
await respondButton.click();
21+
22+
await page.type('#ef-replycontent', COMMENT_TEXT);
23+
24+
const saveReplyButton = await page.$('.ef-replysave');
25+
await saveReplyButton.click();
26+
27+
const commentNodes = await page.waitFor('#ef-comments .comment-content');
28+
29+
const comments = await commentNodes.$$eval('p', nodes => nodes.map(n => {
30+
return n.innerText
31+
}));
32+
33+
expect(comments).toContain(COMMENT_TEXT);
34+
});
35+
});

0 commit comments

Comments
 (0)