You are here

protected function QuickEditJavascriptTestBase::awaitEntityInstanceFieldState 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::awaitEntityInstanceFieldState()

Awaits a particular field instance to reach a particular state.

Parameters

string $entity_type_id: The entity type ID.

int $entity_id: The entity ID.

int $entity_instance_id: The entity instance ID. (Instance on the page.)

string $field_name: The field name.

string $langcode: The language code.

string $awaited_state: One of the possible field states.

1 call to QuickEditJavascriptTestBase::awaitEntityInstanceFieldState()
QuickEditIntegrationTest::testArticleNode in core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditIntegrationTest.php
Tests if an article node can be in-place edited with Quick Edit.

File

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

Class

QuickEditJavascriptTestBase
Base class for testing the QuickEdit.

Namespace

Drupal\Tests\quickedit\FunctionalJavascript

Code

protected function awaitEntityInstanceFieldState($entity_type_id, $entity_id, $entity_instance_id, $field_name, $langcode, $awaited_state) {
  $entity_page_id = $entity_type_id . '/' . $entity_id . '[' . $entity_instance_id . ']';
  $logical_field_id = $entity_type_id . '/' . $entity_id . '/' . $field_name . '/' . $langcode;
  $this
    ->assertJsCondition("Drupal.quickedit.collections.entities.get('{$entity_page_id}').get('fields').findWhere({logicalFieldID: '{$logical_field_id}'}).get('state') === '{$awaited_state}'");
}