Commit a3f40ba1 authored by catch's avatar catch
Browse files

Revert "Issue #3228634 by Spokje, xjm, paulocs, tim.plunkett, Lendude: Move...

Revert "Issue #3228634 by Spokje, xjm, paulocs, tim.plunkett, Lendude: Move tests for integrations between QuickEdit and other modules into QuickEdit so that it can more easily be moved into contrib"

This reverts commit e4ce9936.
parent 6951f4d7
<?php
namespace Drupal\Tests\quickedit\Functional;
namespace Drupal\Tests\editor\Functional;
use Drupal\Component\Serialization\Json;
use Drupal\Core\EventSubscriber\MainContentViewSubscriber;
......@@ -10,9 +10,9 @@
/**
* Tests Quick Edit module integration endpoints.
*
* @group quickedit
* @group editor
*/
class EditorIntegrationLoadingTest extends BrowserTestBase {
class QuickEditIntegrationLoadingTest extends BrowserTestBase {
/**
* Modules to enable.
......@@ -71,7 +71,6 @@ protected function setUp(): void {
* Tests loading of untransformed text when a user doesn't have access to it.
*/
public function testUsersWithoutPermission() {
$this->fail();
// Create 3 users, each with insufficient permissions, i.e. without either
// or both of the following permissions:
// - the 'access in-place editing' permission
......
<?php
namespace Drupal\Tests\quickedit\Kernel;
namespace Drupal\Tests\editor\Kernel;
use Drupal\Component\Serialization\Json;
use Drupal\Core\EventSubscriber\AjaxResponseSubscriber;
......@@ -8,6 +8,7 @@
use Drupal\editor\Entity\Editor;
use Drupal\entity_test\Entity\EntityTest;
use Drupal\quickedit\MetadataGenerator;
use Drupal\Tests\quickedit\Kernel\QuickEditTestBase;
use Drupal\quickedit_test\MockQuickEditEntityFieldAccessCheck;
use Drupal\editor\EditorController;
use Symfony\Component\HttpFoundation\Request;
......@@ -18,9 +19,9 @@
/**
* Tests Edit module integration (Editor module's inline editing support).
*
* @group quickedit
* @group editor
*/
class EditorIntegrationTest extends QuickEditTestBase {
class QuickEditIntegrationTest extends QuickEditTestBase {
/**
* {@inheritdoc}
......@@ -138,7 +139,6 @@ protected function getSelectedEditor($entity_id, $field_name, $view_mode = 'defa
* format compatibility.
*/
public function testEditorSelection() {
$this->fail();
$this->editorManager = $this->container->get('plugin.manager.quickedit.editor');
$this->editorSelector = $this->container->get('quickedit.editor.selector');
......
<?php
namespace Drupal\Tests\quickedit\Functional;
namespace Drupal\Tests\image\Functional;
use Drupal\Component\Serialization\Json;
use Drupal\Tests\BrowserTestBase;
......@@ -10,7 +10,7 @@
/**
* Tests the endpoints used by the "image" in-place editor.
*
* @group quickedit
* @group image
*/
class QuickEditImageControllerTest extends BrowserTestBase {
......@@ -76,7 +76,6 @@ protected function setUp(): void {
* Tests that routes restrict access for un-privileged users.
*/
public function testAccess() {
$this->fail();
// Create an anonymous user.
$user = $this->createUser();
$this->drupalLogin($user);
......
<?php
namespace Drupal\Tests\quickedit\FunctionalJavascript;
namespace Drupal\Tests\image\FunctionalJavascript;
/**
* @see \Drupal\image\Plugin\InPlaceEditor\Image
......
<?php
namespace Drupal\Tests\quickedit\FunctionalJavascript;
namespace Drupal\Tests\image\FunctionalJavascript;
use Drupal\file\Entity\File;
use Drupal\Tests\image\Kernel\ImageFieldCreationTrait;
use Drupal\Tests\quickedit\FunctionalJavascript\QuickEditJavascriptTestBase;
use Drupal\Tests\TestFileCreationTrait;
/**
* @coversDefaultClass \Drupal\image\Plugin\InPlaceEditor\Image
* @group quickedit
* @group image
*/
class QuickEditImageTest extends QuickEditJavascriptTestBase {
......@@ -62,7 +63,6 @@ protected function setUp(): void {
* @covers ::getAttachments
*/
public function testImageInPlaceEditor() {
$this->fail();
// Create a field with a basic filetype restriction.
$field_name = strtolower($this->randomMachineName());
$field_settings = [
......
<?php
namespace Drupal\Tests\quickedit\FunctionalJavascript;
namespace Drupal\Tests\inline_form_errors\FunctionalJavascript;
use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
use Drupal\node\Entity\NodeType;
......@@ -8,9 +8,9 @@
/**
* Tests Inline Form Errors compatibility with Quick Edit.
*
* @group quickedit
* @group inline_form_errors
*/
class InlineFormErrorsIntegrationTest extends WebDriverTestBase {
class FormErrorHandlerQuickEditTest extends WebDriverTestBase {
/**
* Modules to enable.
......@@ -60,7 +60,6 @@ protected function setUp(): void {
* Tests that the inline form errors are not visible for Quick Edit forms.
*/
public function testDisabledInlineFormErrors() {
$this->fail();
$session = $this->getSession();
$web_assert = $this->assertSession();
......
<?php
namespace Drupal\Tests\quickedit\Functional;
namespace Drupal\Tests\layout_builder\Functional;
use Drupal\Tests\BrowserTestBase;
/**
* Tests Layout Builder integration with Quick Edit.
*
* @group quickedit
* @group layout_builder
*/
class LayoutBuilderQuickEditTest extends BrowserTestBase {
......@@ -45,7 +45,6 @@ protected function setUp(): void {
* Tests Quick Edit integration with a block from a different entity type.
*/
public function testPlaceFieldBlockFromDifferentEntityType() {
$this->fail();
$page = $this->getSession()->getPage();
$this->drupalLogin($this->drupalCreateUser([
......
<?php
namespace Drupal\Tests\quickedit\FunctionalJavascript;
namespace Drupal\Tests\layout_builder\FunctionalJavascript;
use Drupal\node\Entity\NodeType;
use Drupal\Tests\contextual\FunctionalJavascript\ContextualLinkClickTrait;
use Drupal\Tests\field\Traits\EntityReferenceTestTrait;
use Drupal\Tests\quickedit\FunctionalJavascript\QuickEditJavascriptTestBase;
/**
* Tests that Layout Builder functions with Quick Edit.
......@@ -12,7 +13,7 @@
* @covers layout_builder_entity_view_alter()
* @covers layout_builder_quickedit_render_field()
*
* @group quickedit
* @group layout_builder
*/
class LayoutBuilderQuickEditTest extends QuickEditJavascriptTestBase {
......@@ -93,7 +94,6 @@ protected function setUp(): void {
* @see https://www.drupal.org/project/drupal/issues/3041850
*/
public function testQuickEditIgnoresDuplicateFields() {
$this->fail();
// Place the body field a second time using Layout Builder.
$this->enableLayouts('admin/structure/types/manage/article/display/default');
$page = $this->getSession()->getPage();
......
......@@ -15,6 +15,7 @@ class MediaEmbedFilterDisabledIntegrationsTest extends MediaEmbedFilterTestBase
*/
protected static $modules = [
'contextual',
'quickedit',
// @see media_test_embed_entity_view_alter()
'media_test_embed',
];
......@@ -28,14 +29,16 @@ protected function setUp(): void {
$this->container->get('current_user')
->addRole($this->drupalCreateRole([
'access contextual links',
'access in-place editing',
]));
}
/**
* @covers ::renderMedia
* @covers ::disableContextualLinks
* @dataProvider providerDisabledIntegrations
*/
public function testDisabledIntegrations() {
public function testDisabledIntegrations($integration_detection_selector) {
$text = $this->createEmbedCode([
'data-entity-type' => 'media',
'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID,
......@@ -43,7 +46,21 @@ public function testDisabledIntegrations() {
$this->applyFilter($text);
$this->assertCount(1, $this->cssSelect('div[data-media-embed-test-view-mode]'));
$this->assertCount(0, $this->cssSelect('div[data-media-embed-test-view-mode].contextual-region'));
$this->assertCount(0, $this->cssSelect($integration_detection_selector));
}
/**
* Data provider for testDisabledIntegrations().
*/
public function providerDisabledIntegrations() {
return [
'contextual' => [
'div[data-media-embed-test-view-mode].contextual-region',
],
'quickedit' => [
'div[data-media-embed-test-view-mode][data-quickedit-entity-id]',
],
];
}
}
<?php
namespace Drupal\Tests\quickedit\Kernel;
use Drupal\Tests\media\Kernel\MediaEmbedFilterTestBase;
/**
* Tests that media embed disables certain integrations.
*
* @coversDefaultClass \Drupal\media\Plugin\Filter\MediaEmbed
* @group quickedit
*/
class MediaEmbedFilterDisabledIntegrationsTest extends MediaEmbedFilterTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'contextual',
'quickedit',
// @see media_test_embed_entity_view_alter()
'media_test_embed',
];
/**
* {@inheritdoc}
*/
protected function setUp(): void {
parent::setUp();
$this->container->get('current_user')
->addRole($this->drupalCreateRole([
'access contextual links',
'access in-place editing',
]));
}
/**
* @covers ::renderMedia
* @covers ::disableContextualLinks
*/
public function testDisabledIntegrations() {
$this->fail();
$text = $this->createEmbedCode([
'data-entity-type' => 'media',
'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID,
]);
$this->applyFilter($text);
$this->assertCount(1, $this->cssSelect('div[data-media-embed-test-view-mode]'));
$this->assertCount(0, $this->cssSelect('div[data-media-embed-test-view-mode][data-quickedit-entity-id]'));
}
}
<?php
namespace Drupal\Tests\quickedit\FunctionalJavascript;
namespace Drupal\Tests\settings_tray\FunctionalJavascript;
use Drupal\block_content\Entity\BlockContent;
use Drupal\block_content\Entity\BlockContentType;
use Drupal\Tests\settings_tray\FunctionalJavascript\SettingsTrayTestBase;
use Drupal\user\Entity\Role;
/**
* Test Settings Tray and Quick Edit modules integration.
*
* @group quickedit
* @group settings_tray
*/
class SettingsTrayIntegrationTest extends SettingsTrayTestBase {
class QuickEditIntegrationTest extends SettingsTrayTestBase {
/**
* {@inheritdoc}
......@@ -48,7 +47,6 @@ protected function setUp(): void {
* Tests QuickEdit links behavior.
*/
public function testQuickEditLinks() {
$this->fail();
$quick_edit_selector = '#quickedit-entity-toolbar';
$node_selector = '[data-quickedit-entity-id="node/1"]';
$body_selector = '[data-quickedit-field-id="node/1/body/en/full"]';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment