{"action":"created","comment":{"url":"https://api.github.com/repos/thunder/paragraphs_features/pulls/comments/188919613","pull_request_review_id":120987667,"id":188919613,"diff_hunk":"@@ -0,0 +1,141 @@\n+<?php\n+\n+namespace Drupal\\Tests\\paragraphs_features\\FunctionalJavascript;\n+\n+/**\n+ * Test display delete confirmation.\n+ *\n+ * @group paragraphs_features\n+ */\n+class ParagraphsFeaturesDeleteConfirmationTest extends ParagraphsFeaturesJavascriptTestBase {\n+\n+  /**\n+   * Test display of delete confirmation.\n+   */\n+  public function testDeleteConfirmation() {\n+    // Create content type with paragraphs field.\n+    $content_type = 'test_delete_confirm';\n+\n+    // Create nested paragraph with addition of one text test paragraph.\n+    $this->createTestConfiguration($content_type, 1);\n+    $this->setupParagraphSettings($content_type);\n+    // 1) Enable setting to show confirmation on remove action.\n+    $this->enableDeleteConfirmation($content_type);\n+\n+    $this->drupalGet(\"node/add/$content_type\");\n+    $session = $this->getSession();\n+    $page = $session->getPage();\n+\n+    // 1a) Check that custom remove button is present and the original remove\n+    // action is hidden.\n+    $is_element_hidden = $session->evaluateScript(\"jQuery('input[data-drupal-selector=\\\"field-paragraphs-0-remove\\\"]').parent('.visually-hidden').length === 1\");\n+    $this->assertEquals(TRUE, $is_element_hidden, 'Original remove button should be hidden.');\n+    $this->assertSession()->elementExists('xpath', '//button[contains(@class, \"paragraphs-features__delete-confirm\")]');\n+\n+    // 1b) Trigger delete confirmation message.\n+    $page->find('xpath', '//button[contains(@class, \"paragraphs-dropdown-toggle\")]')->click();\n+    $page->find('xpath', '//button[contains(@class, \"paragraphs-features__delete-confirm\")]')->click();\n+    // Message and buttons are shown, paragraphs inner form elements should be\n+    // hidden.\n+    $this->assertSession()->elementExists('css', 'div.paragraphs-features__delete-confirmation');\n+    $this->assertSession()->elementExists('css', 'button.paragraphs-features__delete-confirmation__remove-button');\n+    $this->assertSession()->elementExists('css', 'button.paragraphs-features__delete-confirmation__cancel-button');\n+    $are_elements_hidden = $session->evaluateScript(\"jQuery('div[id=\\\"field-paragraphs-0-item-wrapper\\\"]').children().length - jQuery('div[id=\\\"field-paragraphs-0-item-wrapper\\\"]').children('.visually-hidden').length === 1\");","path":"tests/src/FunctionalJavascript/ParagraphsFeaturesDeleteConfirmationTest.php","position":43,"original_position":43,"commit_id":"6fed7cddd1af659c2ed4f481609b9c24d123e0cb","original_commit_id":"6fed7cddd1af659c2ed4f481609b9c24d123e0cb","user":{"login":"mtodor","id":3965286,"avatar_url":"https://avatars2.githubusercontent.com/u/3965286?v=4","gravatar_id":"","url":"https://api.github.com/users/mtodor","html_url":"https://github.com/mtodor","followers_url":"https://api.github.com/users/mtodor/followers","following_url":"https://api.github.com/users/mtodor/following{/other_user}","gists_url":"https://api.github.com/users/mtodor/gists{/gist_id}","starred_url":"https://api.github.com/users/mtodor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtodor/subscriptions","organizations_url":"https://api.github.com/users/mtodor/orgs","repos_url":"https://api.github.com/users/mtodor/repos","events_url":"https://api.github.com/users/mtodor/events{/privacy}","received_events_url":"https://api.github.com/users/mtodor/received_events","type":"User","site_admin":false},"body":"I think it would be better to use Drupal selector (for example `data-drupal-selector=\"edit-field-paragraphs-demo-0\"` here and then check that parent has class `.visually-hidden`.","created_at":"2018-05-17T11:05:26Z","updated_at":"2018-05-17T11:14:10Z","html_url":"https://github.com/thunder/paragraphs_features/pull/12#discussion_r188919613","pull_request_url":"https://api.github.com/repos/thunder/paragraphs_features/pulls/12","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/thunder/paragraphs_features/pulls/comments/188919613"},"html":{"href":"https://github.com/thunder/paragraphs_features/pull/12#discussion_r188919613"},"pull_request":{"href":"https://api.github.com/repos/thunder/paragraphs_features/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/thunder/paragraphs_features/pulls/12","id":186640905,"html_url":"https://github.com/thunder/paragraphs_features/pull/12","diff_url":"https://github.com/thunder/paragraphs_features/pull/12.diff","patch_url":"https://github.com/thunder/paragraphs_features/pull/12.patch","issue_url":"https://api.github.com/repos/thunder/paragraphs_features/issues/12","number":12,"state":"open","locked":false,"title":"Issue #2833922: Introduce a quick but safe way to remove/delete paragraphs","user":{"login":"ol0lll","id":5558666,"avatar_url":"https://avatars0.githubusercontent.com/u/5558666?v=4","gravatar_id":"","url":"https://api.github.com/users/ol0lll","html_url":"https://github.com/ol0lll","followers_url":"https://api.github.com/users/ol0lll/followers","following_url":"https://api.github.com/users/ol0lll/following{/other_user}","gists_url":"https://api.github.com/users/ol0lll/gists{/gist_id}","starred_url":"https://api.github.com/users/ol0lll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ol0lll/subscriptions","organizations_url":"https://api.github.com/users/ol0lll/orgs","repos_url":"https://api.github.com/users/ol0lll/repos","events_url":"https://api.github.com/users/ol0lll/events{/privacy}","received_events_url":"https://api.github.com/users/ol0lll/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-08T13:50:38Z","updated_at":"2018-05-17T11:14:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"98ac783ecadeaaa9f0fb468a18d8c1dd86ce986a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/thunder/paragraphs_features/pulls/12/commits","review_comments_url":"https://api.github.com/repos/thunder/paragraphs_features/pulls/12/comments","review_comment_url":"https://api.github.com/repos/thunder/paragraphs_features/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thunder/paragraphs_features/issues/12/comments","statuses_url":"https://api.github.com/repos/thunder/paragraphs_features/statuses/6fed7cddd1af659c2ed4f481609b9c24d123e0cb","head":{"label":"thunder:feature/2833922-paragraphs-delete-confirmation","ref":"feature/2833922-paragraphs-delete-confirmation","sha":"6fed7cddd1af659c2ed4f481609b9c24d123e0cb","user":{"login":"thunder","id":6271471,"avatar_url":"https://avatars1.githubusercontent.com/u/6271471?v=4","gravatar_id":"","url":"https://api.github.com/users/thunder","html_url":"https://github.com/thunder","followers_url":"https://api.github.com/users/thunder/followers","following_url":"https://api.github.com/users/thunder/following{/other_user}","gists_url":"https://api.github.com/users/thunder/gists{/gist_id}","starred_url":"https://api.github.com/users/thunder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thunder/subscriptions","organizations_url":"https://api.github.com/users/thunder/orgs","repos_url":"https://api.github.com/users/thunder/repos","events_url":"https://api.github.com/users/thunder/events{/privacy}","received_events_url":"https://api.github.com/users/thunder/received_events","type":"Organization","site_admin":false},"repo":{"id":122356539,"name":"paragraphs_features","full_name":"thunder/paragraphs_features","owner":{"login":"thunder","id":6271471,"avatar_url":"https://avatars1.githubusercontent.com/u/6271471?v=4","gravatar_id":"","url":"https://api.github.com/users/thunder","html_url":"https://github.com/thunder","followers_url":"https://api.github.com/users/thunder/followers","following_url":"https://api.github.com/users/thunder/following{/other_user}","gists_url":"https://api.github.com/users/thunder/gists{/gist_id}","starred_url":"https://api.github.com/users/thunder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thunder/subscriptions","organizations_url":"https://api.github.com/users/thunder/orgs","repos_url":"https://api.github.com/users/thunder/repos","events_url":"https://api.github.com/users/thunder/events{/privacy}","received_events_url":"https://api.github.com/users/thunder/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thunder/paragraphs_features","description":null,"fork":false,"url":"https://api.github.com/repos/thunder/paragraphs_features","forks_url":"https://api.github.com/repos/thunder/paragraphs_features/forks","keys_url":"https://api.github.com/repos/thunder/paragraphs_features/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thunder/paragraphs_features/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thunder/paragraphs_features/teams","hooks_url":"https://api.github.com/repos/thunder/paragraphs_features/hooks","issue_events_url":"https://api.github.com/repos/thunder/paragraphs_features/issues/events{/number}","events_url":"https://api.github.com/repos/thunder/paragraphs_features/events","assignees_url":"https://api.github.com/repos/thunder/paragraphs_features/assignees{/user}","branches_url":"https://api.github.com/repos/thunder/paragraphs_features/branches{/branch}","tags_url":"https://api.github.com/repos/thunder/paragraphs_features/tags","blobs_url":"https://api.github.com/repos/thunder/paragraphs_features/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thunder/paragraphs_features/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thunder/paragraphs_features/git/refs{/sha}","trees_url":"https://api.github.com/repos/thunder/paragraphs_features/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thunder/paragraphs_features/statuses/{sha}","languages_url":"https://api.github.com/repos/thunder/paragraphs_features/languages","stargazers_url":"https://api.github.com/repos/thunder/paragraphs_features/stargazers","contributors_url":"https://api.github.com/repos/thunder/paragraphs_features/contributors","subscribers_url":"https://api.github.com/repos/thunder/paragraphs_features/subscribers","subscription_url":"https://api.github.com/repos/thunder/paragraphs_features/subscription","commits_url":"https://api.github.com/repos/thunder/paragraphs_features/commits{/sha}","git_commits_url":"https://api.github.com/repos/thunder/paragraphs_features/git/commits{/sha}","comments_url":"https://api.github.com/repos/thunder/paragraphs_features/comments{/number}","issue_comment_url":"https://api.github.com/repos/thunder/paragraphs_features/issues/comments{/number}","contents_url":"https://api.github.com/repos/thunder/paragraphs_features/contents/{+path}","compare_url":"https://api.github.com/repos/thunder/paragraphs_features/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thunder/paragraphs_features/merges","archive_url":"https://api.github.com/repos/thunder/paragraphs_features/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thunder/paragraphs_features/downloads","issues_url":"https://api.github.com/repos/thunder/paragraphs_features/issues{/number}","pulls_url":"https://api.github.com/repos/thunder/paragraphs_features/pulls{/number}","milestones_url":"https://api.github.com/repos/thunder/paragraphs_features/milestones{/number}","notifications_url":"https://api.github.com/repos/thunder/paragraphs_features/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thunder/paragraphs_features/labels{/name}","releases_url":"https://api.github.com/repos/thunder/paragraphs_features/releases{/id}","deployments_url":"https://api.github.com/repos/thunder/paragraphs_features/deployments","created_at":"2018-02-21T15:48:26Z","updated_at":"2018-05-02T13:33:55Z","pushed_at":"2018-05-14T09:32:46Z","git_url":"git://github.com/thunder/paragraphs_features.git","ssh_url":"git@github.com:thunder/paragraphs_features.git","clone_url":"https://github.com/thunder/paragraphs_features.git","svn_url":"https://github.com/thunder/paragraphs_features","homepage":null,"size":50,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":1,"open_issues":1,"watchers":0,"default_branch":"8.x-1.x"}},"base":{"label":"thunder:8.x-1.x","ref":"8.x-1.x","sha":"2effc3dd501b3e9adc2dcfaa224d0108c97f7283","user":{"login":"thunder","id":6271471,"avatar_url":"https://avatars1.githubusercontent.com/u/6271471?v=4","gravatar_id":"","url":"https://api.github.com/users/thunder","html_url":"https://github.com/thunder","followers_url":"https://api.github.com/users/thunder/followers","following_url":"https://api.github.com/users/thunder/following{/other_user}","gists_url":"https://api.github.com/users/thunder/gists{/gist_id}","starred_url":"https://api.github.com/users/thunder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thunder/subscriptions","organizations_url":"https://api.github.com/users/thunder/orgs","repos_url":"https://api.github.com/users/thunder/repos","events_url":"https://api.github.com/users/thunder/events{/privacy}","received_events_url":"https://api.github.com/users/thunder/received_events","type":"Organization","site_admin":false},"repo":{"id":122356539,"name":"paragraphs_features","full_name":"thunder/paragraphs_features","owner":{"login":"thunder","id":6271471,"avatar_url":"https://avatars1.githubusercontent.com/u/6271471?v=4","gravatar_id":"","url":"https://api.github.com/users/thunder","html_url":"https://github.com/thunder","followers_url":"https://api.github.com/users/thunder/followers","following_url":"https://api.github.com/users/thunder/following{/other_user}","gists_url":"https://api.github.com/users/thunder/gists{/gist_id}","starred_url":"https://api.github.com/users/thunder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thunder/subscriptions","organizations_url":"https://api.github.com/users/thunder/orgs","repos_url":"https://api.github.com/users/thunder/repos","events_url":"https://api.github.com/users/thunder/events{/privacy}","received_events_url":"https://api.github.com/users/thunder/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thunder/paragraphs_features","description":null,"fork":false,"url":"https://api.github.com/repos/thunder/paragraphs_features","forks_url":"https://api.github.com/repos/thunder/paragraphs_features/forks","keys_url":"https://api.github.com/repos/thunder/paragraphs_features/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thunder/paragraphs_features/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thunder/paragraphs_features/teams","hooks_url":"https://api.github.com/repos/thunder/paragraphs_features/hooks","issue_events_url":"https://api.github.com/repos/thunder/paragraphs_features/issues/events{/number}","events_url":"https://api.github.com/repos/thunder/paragraphs_features/events","assignees_url":"https://api.github.com/repos/thunder/paragraphs_features/assignees{/user}","branches_url":"https://api.github.com/repos/thunder/paragraphs_features/branches{/branch}","tags_url":"https://api.github.com/repos/thunder/paragraphs_features/tags","blobs_url":"https://api.github.com/repos/thunder/paragraphs_features/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thunder/paragraphs_features/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thunder/paragraphs_features/git/refs{/sha}","trees_url":"https://api.github.com/repos/thunder/paragraphs_features/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thunder/paragraphs_features/statuses/{sha}","languages_url":"https://api.github.com/repos/thunder/paragraphs_features/languages","stargazers_url":"https://api.github.com/repos/thunder/paragraphs_features/stargazers","contributors_url":"https://api.github.com/repos/thunder/paragraphs_features/contributors","subscribers_url":"https://api.github.com/repos/thunder/paragraphs_features/subscribers","subscription_url":"https://api.github.com/repos/thunder/paragraphs_features/subscription","commits_url":"https://api.github.com/repos/thunder/paragraphs_features/commits{/sha}","git_commits_url":"https://api.github.com/repos/thunder/paragraphs_features/git/commits{/sha}","comments_url":"https://api.github.com/repos/thunder/paragraphs_features/comments{/number}","issue_comment_url":"https://api.github.com/repos/thunder/paragraphs_features/issues/comments{/number}","contents_url":"https://api.github.com/repos/thunder/paragraphs_features/contents/{+path}","compare_url":"https://api.github.com/repos/thunder/paragraphs_features/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thunder/paragraphs_features/merges","archive_url":"https://api.github.com/repos/thunder/paragraphs_features/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thunder/paragraphs_features/downloads","issues_url":"https://api.github.com/repos/thunder/paragraphs_features/issues{/number}","pulls_url":"https://api.github.com/repos/thunder/paragraphs_features/pulls{/number}","milestones_url":"https://api.github.com/repos/thunder/paragraphs_features/milestones{/number}","notifications_url":"https://api.github.com/repos/thunder/paragraphs_features/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thunder/paragraphs_features/labels{/name}","releases_url":"https://api.github.com/repos/thunder/paragraphs_features/releases{/id}","deployments_url":"https://api.github.com/repos/thunder/paragraphs_features/deployments","created_at":"2018-02-21T15:48:26Z","updated_at":"2018-05-02T13:33:55Z","pushed_at":"2018-05-14T09:32:46Z","git_url":"git://github.com/thunder/paragraphs_features.git","ssh_url":"git@github.com:thunder/paragraphs_features.git","clone_url":"https://github.com/thunder/paragraphs_features.git","svn_url":"https://github.com/thunder/paragraphs_features","homepage":null,"size":50,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":1,"open_issues":1,"watchers":0,"default_branch":"8.x-1.x"}},"_links":{"self":{"href":"https://api.github.com/repos/thunder/paragraphs_features/pulls/12"},"html":{"href":"https://github.com/thunder/paragraphs_features/pull/12"},"issue":{"href":"https://api.github.com/repos/thunder/paragraphs_features/issues/12"},"comments":{"href":"https://api.github.com/repos/thunder/paragraphs_features/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/thunder/paragraphs_features/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/thunder/paragraphs_features/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thunder/paragraphs_features/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/thunder/paragraphs_features/statuses/6fed7cddd1af659c2ed4f481609b9c24d123e0cb"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"mtodor"}}