function QuickEditJavascriptTestBase::assertEntityInstanceStates
Same name in other branches
- 8.9.x core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditJavascriptTestBase.php \Drupal\Tests\quickedit\FunctionalJavascript\QuickEditJavascriptTestBase::assertEntityInstanceStates()
Asserts all EntityModels (entity instances) on the page.
Parameters
array $expected_entity_states: Must describe the expected state of all in-place editable entity instances on the page.
See also
Drupal.quickedit.EntityModel
6 calls to QuickEditJavascriptTestBase::assertEntityInstanceStates()
- CKEditor5IntegrationTest::testArticleNode in core/
modules/ quickedit/ tests/ src/ FunctionalJavascript/ CKEditor5IntegrationTest.php - Tests if an article node can be in-place edited with Quick Edit.
- CKEditor5IntegrationTest::testDiscard in core/
modules/ quickedit/ tests/ src/ FunctionalJavascript/ CKEditor5IntegrationTest.php - Tests that changes can be discarded.
- LayoutBuilderIntegrationTest::testArticleNode in core/
modules/ quickedit/ tests/ src/ FunctionalJavascript/ LayoutBuilderIntegrationTest.php - Tests if an article node can be in-place edited with Quick Edit.
- LayoutBuilderIntegrationTest::testCustomBlock in core/
modules/ quickedit/ tests/ src/ FunctionalJavascript/ LayoutBuilderIntegrationTest.php - Tests if a custom can be in-place edited with Quick Edit.
- LayoutBuilderQuickEditTest::assertQuickEditInit in core/
modules/ quickedit/ tests/ src/ FunctionalJavascript/ LayoutBuilderQuickEditTest.php - Asserts that Quick Edit is initialized on the node view correctly.
File
-
core/
modules/ quickedit/ tests/ src/ FunctionalJavascript/ QuickEditJavascriptTestBase.php, line 195
Class
- QuickEditJavascriptTestBase
- Base class for testing the QuickEdit.
Namespace
Drupal\Tests\quickedit\FunctionalJavascriptCode
protected function assertEntityInstanceStates(array $expected_entity_states) {
$js_get_all_field_states_for_entity = <<<JS
function () {
Drupal.quickedit.collections.entities.reduce(function (result, fieldModel) { result[fieldModel.get('id')] = fieldModel.get('state'); return result; }, {})
var entityCollection = Drupal.quickedit.collections.entities;
return entityCollection.reduce(function (result, entityModel) {
result[entityModel.id] = entityModel.get('state');
return result;
}, {});
}()
JS;
$this->assertSame($expected_entity_states, $this->getSession()
->evaluateScript($js_get_all_field_states_for_entity));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.