You are here

protected function QuickEditJavascriptTestBase::awaitQuickEditForEntity in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditJavascriptTestBase.php \Drupal\Tests\quickedit\FunctionalJavascript\QuickEditJavascriptTestBase::awaitQuickEditForEntity()

Awaits Quick Edit to be initiated for all instances of the given entity.

Parameters

string $entity_type_id: The entity type ID.

int $entity_id: The entity ID.

5 calls to QuickEditJavascriptTestBase::awaitQuickEditForEntity()
LayoutBuilderQuickEditTest::assertQuickEditInit in core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php
Asserts that Quick Edit is initialized on the node view correctly.
QuickEditFileTest::testRemove in core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditFileTest.php
Tests if a file can be in-place removed with Quick Edit.
QuickEditImageTest::testImageInPlaceEditor in core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditImageTest.php
Tests that quick editor works correctly with images.
QuickEditIntegrationTest::testArticleNode in core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditIntegrationTest.php
Tests if an article node can be in-place edited with Quick Edit.
QuickEditIntegrationTest::testCustomBlock in core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditIntegrationTest.php
Tests if a custom can be in-place edited with Quick Edit.

File

core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditJavascriptTestBase.php, line 127

Class

QuickEditJavascriptTestBase
Base class for testing the QuickEdit.

Namespace

Drupal\Tests\quickedit\FunctionalJavascript

Code

protected function awaitQuickEditForEntity($entity_type_id, $entity_id) {
  $entity_selector = '[data-quickedit-entity-id="' . $entity_type_id . '/' . $entity_id . '"]';
  $condition = "document.querySelectorAll('" . $entity_selector . "').length === document.querySelectorAll('" . $entity_selector . " .quickedit').length";
  $this
    ->assertJsCondition($condition, 10000);
}